From patchwork Fri May 7 10:20:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiapeng Chong X-Patchwork-Id: 1475454 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org; receiver=) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Fc61S4LQvz9sRK for ; Fri, 7 May 2021 20:21:32 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Fc61S4Bpzz2yjS for ; Fri, 7 May 2021 20:21:32 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.alibaba.com (client-ip=47.88.44.36; helo=out4436.biz.mail.alibaba.com; envelope-from=jiapeng.chong@linux.alibaba.com; receiver=) Received: from out4436.biz.mail.alibaba.com (out4436.biz.mail.alibaba.com [47.88.44.36]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Fc6182T6Sz2xZR for ; Fri, 7 May 2021 20:21:14 +1000 (AEST) X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R551e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=alimailimapcm10staff010182156082; MF=jiapeng.chong@linux.alibaba.com; NM=1; PH=DS; RN=6; SR=0; TI=SMTPD_---0UY2DuHm_1620382853; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0UY2DuHm_1620382853) by smtp.aliyun-inc.com(127.0.0.1); Fri, 07 May 2021 18:20:58 +0800 From: Jiapeng Chong To: mpe@ellerman.id.au Subject: [PATCH] powerpc/xive: Fix unsigned comparison with less than zero Date: Fri, 7 May 2021 18:20:51 +0800 Message-Id: <1620382851-67480-1-git-send-email-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jiapeng Chong , paulus@samba.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The return from the call to irq_domain_alloc_irqs() is int, it can be a negative error code, however this is being assigned to an unsigned int variable 'irq', this may lead to invalid if statement detection, so that kfree execution is invalid. So making 'irq' an int. Clean up the following coccicheck warning: ./arch/powerpc/sysdev/xive/common.c:1157:6-14: WARNING: Unsigned expression compared with zero: xid -> irq < 0. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong --- arch/powerpc/sysdev/xive/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysdev/xive/common.c index a830432..a5fd45a 100644 --- a/arch/powerpc/sysdev/xive/common.c +++ b/arch/powerpc/sysdev/xive/common.c @@ -65,7 +65,7 @@ #ifdef CONFIG_SMP /* The IPIs use the same logical irq number when on the same chip */ static struct xive_ipi_desc { - unsigned int irq; + int irq; char name[16]; } *xive_ipis;