Skip to content

Commit 3f60160

Browse files
legoatermpe
authored andcommitted
powerpc/xive: Fix error handling when allocating an IPI
This is a smatch warning: arch/powerpc/sysdev/xive/common.c:1161 xive_request_ipi() warn: unsigned 'xid->irq' is never less than zero. Fixes: fd6db28 ("powerpc/xive: Modernize XIVE-IPI domain with an 'alloc' handler") Cc: stable@vger.kernel.org # v5.13 Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Cédric Le Goater <clg@kaod.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20210701152412.1507612-1-clg@kaod.org
1 parent 307e504 commit 3f60160

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

arch/powerpc/sysdev/xive/common.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,11 +1153,10 @@ static int __init xive_request_ipi(void)
11531153
* Since the HW interrupt number doesn't have any meaning,
11541154
* simply use the node number.
11551155
*/
1156-
xid->irq = irq_domain_alloc_irqs(ipi_domain, 1, node, &info);
1157-
if (xid->irq < 0) {
1158-
ret = xid->irq;
1156+
ret = irq_domain_alloc_irqs(ipi_domain, 1, node, &info);
1157+
if (ret < 0)
11591158
goto out_free_xive_ipis;
1160-
}
1159+
xid->irq = ret;
11611160

11621161
snprintf(xid->name, sizeof(xid->name), "IPI-%d", node);
11631162

0 commit comments

Comments
 (0)