Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

irqchip/nvic: Release nvic_base upon failure

smatch warning was reported as below ->

smatch warnings:
drivers/irqchip/irq-nvic.c:131 nvic_of_init()
warn: 'nvic_base' not released on lines: 97.

Release nvic_base upon failure.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Souptick Joarder (HPE) <jrdr.linux@gmail.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220218163303.33344-1-jrdr.linux@gmail.com

authored by

Souptick Joarder (HPE) and committed by
Marc Zyngier
e414c25e 80e4e1f4

+2
+2
drivers/irqchip/irq-nvic.c
··· 107 107 108 108 if (!nvic_irq_domain) { 109 109 pr_warn("Failed to allocate irq domain\n"); 110 + iounmap(nvic_base); 110 111 return -ENOMEM; 111 112 } 112 113 ··· 117 116 if (ret) { 118 117 pr_warn("Failed to allocate irq chips\n"); 119 118 irq_domain_remove(nvic_irq_domain); 119 + iounmap(nvic_base); 120 120 return ret; 121 121 } 122 122