[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202107030700.SB4h6CEa-lkp@intel.com>
Date: Sat, 3 Jul 2021 15:50:36 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: kbuild@...ts.01.org, Hector Martin <marcan@...can.st>
Cc: lkp@...el.com, kbuild-all@...ts.01.org,
linux-kernel@...r.kernel.org, Marc Zyngier <maz@...nel.org>
Subject: drivers/irqchip/irq-apple-aic.c:849 aic_of_ic_init() warn: 'regs'
not released on lines: 803.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 35e43538af8fd2cb39d58caca1134a87db173f75
commit: 76cde26394114f6af2710c6b2ad6854f1e8ee859 irqchip/apple-aic: Add support for the Apple Interrupt Controller
config: arm64-randconfig-m031-20210702 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
smatch warnings:
drivers/irqchip/irq-apple-aic.c:849 aic_of_ic_init() warn: 'regs' not released on lines: 803.
vim +/regs +849 drivers/irqchip/irq-apple-aic.c
76cde26394114f Hector Martin 2021-01-21 790 static int __init aic_of_ic_init(struct device_node *node, struct device_node *parent)
76cde26394114f Hector Martin 2021-01-21 791 {
76cde26394114f Hector Martin 2021-01-21 792 int i;
76cde26394114f Hector Martin 2021-01-21 793 void __iomem *regs;
76cde26394114f Hector Martin 2021-01-21 794 u32 info;
76cde26394114f Hector Martin 2021-01-21 795 struct aic_irq_chip *irqc;
76cde26394114f Hector Martin 2021-01-21 796
76cde26394114f Hector Martin 2021-01-21 797 regs = of_iomap(node, 0);
76cde26394114f Hector Martin 2021-01-21 798 if (WARN_ON(!regs))
76cde26394114f Hector Martin 2021-01-21 799 return -EIO;
76cde26394114f Hector Martin 2021-01-21 800
76cde26394114f Hector Martin 2021-01-21 801 irqc = kzalloc(sizeof(*irqc), GFP_KERNEL);
76cde26394114f Hector Martin 2021-01-21 802 if (!irqc)
76cde26394114f Hector Martin 2021-01-21 803 return -ENOMEM;
iounmap() before returning.
76cde26394114f Hector Martin 2021-01-21 804
76cde26394114f Hector Martin 2021-01-21 805 aic_irqc = irqc;
76cde26394114f Hector Martin 2021-01-21 806 irqc->base = regs;
76cde26394114f Hector Martin 2021-01-21 807
76cde26394114f Hector Martin 2021-01-21 808 info = aic_ic_read(irqc, AIC_INFO);
76cde26394114f Hector Martin 2021-01-21 809 irqc->nr_hw = FIELD_GET(AIC_INFO_NR_HW, info);
76cde26394114f Hector Martin 2021-01-21 810
76cde26394114f Hector Martin 2021-01-21 811 irqc->hw_domain = irq_domain_create_linear(of_node_to_fwnode(node),
76cde26394114f Hector Martin 2021-01-21 812 irqc->nr_hw + AIC_NR_FIQ,
76cde26394114f Hector Martin 2021-01-21 813 &aic_irq_domain_ops, irqc);
76cde26394114f Hector Martin 2021-01-21 814 if (WARN_ON(!irqc->hw_domain)) {
76cde26394114f Hector Martin 2021-01-21 815 iounmap(irqc->base);
76cde26394114f Hector Martin 2021-01-21 816 kfree(irqc);
76cde26394114f Hector Martin 2021-01-21 817 return -ENODEV;
76cde26394114f Hector Martin 2021-01-21 818 }
76cde26394114f Hector Martin 2021-01-21 819
76cde26394114f Hector Martin 2021-01-21 820 irq_domain_update_bus_token(irqc->hw_domain, DOMAIN_BUS_WIRED);
76cde26394114f Hector Martin 2021-01-21 821
76cde26394114f Hector Martin 2021-01-21 822 if (aic_init_smp(irqc, node)) {
76cde26394114f Hector Martin 2021-01-21 823 irq_domain_remove(irqc->hw_domain);
76cde26394114f Hector Martin 2021-01-21 824 iounmap(irqc->base);
76cde26394114f Hector Martin 2021-01-21 825 kfree(irqc);
76cde26394114f Hector Martin 2021-01-21 826 return -ENODEV;
76cde26394114f Hector Martin 2021-01-21 827 }
76cde26394114f Hector Martin 2021-01-21 828
76cde26394114f Hector Martin 2021-01-21 829 set_handle_irq(aic_handle_irq);
76cde26394114f Hector Martin 2021-01-21 830 set_handle_fiq(aic_handle_fiq);
76cde26394114f Hector Martin 2021-01-21 831
76cde26394114f Hector Martin 2021-01-21 832 for (i = 0; i < BITS_TO_U32(irqc->nr_hw); i++)
76cde26394114f Hector Martin 2021-01-21 833 aic_ic_write(irqc, AIC_MASK_SET + i * 4, U32_MAX);
76cde26394114f Hector Martin 2021-01-21 834 for (i = 0; i < BITS_TO_U32(irqc->nr_hw); i++)
76cde26394114f Hector Martin 2021-01-21 835 aic_ic_write(irqc, AIC_SW_CLR + i * 4, U32_MAX);
76cde26394114f Hector Martin 2021-01-21 836 for (i = 0; i < irqc->nr_hw; i++)
76cde26394114f Hector Martin 2021-01-21 837 aic_ic_write(irqc, AIC_TARGET_CPU + i * 4, 1);
76cde26394114f Hector Martin 2021-01-21 838
76cde26394114f Hector Martin 2021-01-21 839 if (!is_kernel_in_hyp_mode())
76cde26394114f Hector Martin 2021-01-21 840 pr_info("Kernel running in EL1, mapping interrupts");
76cde26394114f Hector Martin 2021-01-21 841
76cde26394114f Hector Martin 2021-01-21 842 cpuhp_setup_state(CPUHP_AP_IRQ_APPLE_AIC_STARTING,
76cde26394114f Hector Martin 2021-01-21 843 "irqchip/apple-aic/ipi:starting",
76cde26394114f Hector Martin 2021-01-21 844 aic_init_cpu, NULL);
76cde26394114f Hector Martin 2021-01-21 845
76cde26394114f Hector Martin 2021-01-21 846 pr_info("Initialized with %d IRQs, %d FIQs, %d vIPIs\n",
76cde26394114f Hector Martin 2021-01-21 847 irqc->nr_hw, AIC_NR_FIQ, AIC_NR_SWIPI);
76cde26394114f Hector Martin 2021-01-21 848
76cde26394114f Hector Martin 2021-01-21 @849 return 0;
76cde26394114f Hector Martin 2021-01-21 850 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Powered by blists - more mailing lists