Skip to content

Commit

Permalink
powerpc/xive: Fix error handling when allocating an IPI
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Cédric Le Goater authored and Michael Ellerman committed Jul 5, 2021
1 parent 307e504 commit 3f60160
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions arch/powerpc/sysdev/xive/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1153,11 +1153,10 @@ static int __init xive_request_ipi(void)
* Since the HW interrupt number doesn't have any meaning,
* simply use the node number.
*/
xid->irq = irq_domain_alloc_irqs(ipi_domain, 1, node, &info);
if (xid->irq < 0) {
ret = xid->irq;
ret = irq_domain_alloc_irqs(ipi_domain, 1, node, &info);
if (ret < 0)
goto out_free_xive_ipis;
}
xid->irq = ret;

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

Expand Down

0 comments on commit 3f60160

Please sign in to comment.