From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7FA89C433B4 for ; Fri, 7 May 2021 10:21:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 367B561443 for ; Fri, 7 May 2021 10:21:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234780AbhEGKWD (ORCPT ); Fri, 7 May 2021 06:22:03 -0400 Received: from out30-42.freemail.mail.aliyun.com ([115.124.30.42]:45561 "EHLO out30-42.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233362AbhEGKWA (ORCPT ); Fri, 7 May 2021 06:22:00 -0400 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 Cc: benh@kernel.crashing.org, paulus@samba.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Jiapeng Chong 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 1.8.3.1