Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp658084pxv; Thu, 15 Jul 2021 12:41:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBGTl0pRThobZkGYQe4bDc5ir1PyDX6ZWVy+ErHpvSb2OD2RXWqQBtN5Z53qJO503Mv3X8 X-Received: by 2002:a05:6402:1347:: with SMTP id y7mr9385679edw.87.1626378094131; Thu, 15 Jul 2021 12:41:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626378094; cv=none; d=google.com; s=arc-20160816; b=YzEhEZbcfY4lTcTGxeDKpJ1yTAFvVcd38rQd2inetBrdKV8zD1cyNVy8VXMYNq1ldx +0s6JhAY2WRHb+wqydBy8JzUrd6+8zb7LJzgeg0hTOvqIj8DMmgTWRTDGD/StxRKNJ0n 3YkB9yELbe3KfM8mEeF9pb50/6viN72UP9plSGTBW3IbVCSTF/MewwIjq8D6AataZwZ+ yX6eFAoPy6WMYtmjnyk6B/aH4R9xVwf0lAMr0oCyDkRp0sUD9/ANRStLOQ05/DfXFWEH PrY2qt435NayfjTVICOZjQN6Ma/8xh3HB/Xp8DGbPRapWikwlg0NA2wOIcQe+VA7fP3l v9ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=iv8hO2tLLApMC+cddDMu7qz5t72LmgEt8/XdCvRY580=; b=bFEplmqWr23hleHTXlW1dcJqJHb3oZv+Wg698Pj+5RofMdPj/jzsSo7c/TRX7uTMmE Ygcu/uBexPEXK0k46rOpl5AM03I+VOy8p8lU9H0JAt14W7RpxaqDJlU88mJpA0FJAWGx Wd5P/oLMMMbmLDdMaTkVZS/K/098tAUgjoxfBfneRcKChlPVh/DsquYKrpeYcs4fqwEM TEF1HLN05d/5YUpRA5zF3VggJfETkNrm1NYbvZ2YG0aWFkbI1ctGjzyl5nu1uHgwG1OC XnHTIazdhTM4kwnndppAUJU/+hpEwdUjUB/6nBda13U7V5S/he/Sb84Pxfd8X0tOGNzn gqxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BvoZX0hx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w5si8069565edc.581.2021.07.15.12.41.11; Thu, 15 Jul 2021 12:41:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BvoZX0hx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345525AbhGOTk6 (ORCPT + 99 others); Thu, 15 Jul 2021 15:40:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:50684 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244436AbhGOTOs (ORCPT ); Thu, 15 Jul 2021 15:14:48 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1A05D613FC; Thu, 15 Jul 2021 19:10:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626376229; bh=vyj3stJ8GDoobQWKF9oJ1Xi5HvGchXFYvMePAOqiv6A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BvoZX0hxQwbkkMfY7oghif8SgMgYSMxLB3Khv+ROTNngi8OZ1ffdhP/iUSHGHtDIn S5lcLcmiC4WFQoVU1zIZHUdiFlBKHhb4uEoFfXY6v4Gy51XDSSn6ohHzj4U4fgyYBp AHJq1d8DHuEQ+Wmv+uU+z6ntKrqrdWNgTSqe6egE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kernel test robot , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Michael Ellerman Subject: [PATCH 5.13 182/266] powerpc/xive: Fix error handling when allocating an IPI Date: Thu, 15 Jul 2021 20:38:57 +0200 Message-Id: <20210715182643.664089292@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182613.933608881@linuxfoundation.org> References: <20210715182613.933608881@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Cédric Le Goater commit 3f601608b71c3ca1e199898cd16f09d707fedb56 upstream. 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: fd6db2892eba ("powerpc/xive: Modernize XIVE-IPI domain with an 'alloc' handler") Cc: stable@vger.kernel.org # v5.13 Reported-by: kernel test robot Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210701152412.1507612-1-clg@kaod.org Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/sysdev/xive/common.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) --- a/arch/powerpc/sysdev/xive/common.c +++ b/arch/powerpc/sysdev/xive/common.c @@ -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);