Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4526432rwb; Tue, 6 Sep 2022 08:42:33 -0700 (PDT) X-Google-Smtp-Source: AA6agR6vyWvDxj/Y6xLPQNCTdUOlENwLGCxV6EfgdGtdTCLgDsLMv7SuphafdcwBJ4IDWhJ0m5WK X-Received: by 2002:a63:88c8:0:b0:42b:59d4:ea81 with SMTP id l191-20020a6388c8000000b0042b59d4ea81mr44411309pgd.344.1662478952926; Tue, 06 Sep 2022 08:42:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662478952; cv=none; d=google.com; s=arc-20160816; b=CnenaWRUXSOmV/gvQquL54bcg8ZbSsXioeio/el1oXZZw++iIRo7Mb43kjkkphz9PK uOlBG2h+osB83BHwbrpeYDBa4Bm/pT89xcoVmJ7KHs7dcu0vZVnxj2R86+JZtNmrk/xn hz9VINJFQrO0gbKUBHi9VLdfOqmoV+AJX1+Z19mVLkGkaLnOwvAg7XdDO+JAu2eN5pQg AmL8ciXU0wu1R37rchbKAwjRpARe5I4J+Cug3cwLg2ksd7F0tzwf0D1Ye5B21NU6JJAL SZfJ0Qk6g7TlANC86mFP5KSlt86o6SksdQPSaLwB9kza8UGTERLAAmscAL1G5G+RIrJa DVGg== 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=zBAkINz90KQMN/nPQjvKdlIFD3W3X0AlOi7kGUXDHhI=; b=HXW/vb4z9QzZCPAerH+mYSP6vf84Ai9NO4cw4zw3+qujx/ggGSFYpCuemXvd7Lwbl5 pMpcOkr2KtTygD5rMCVP1maj4pSD+fogFryG8nZAT+hPoHtva8VgNwGaW6RkprU/osp4 r4ww9pCAG4woEikb6lyNykXVsHCH9t/b6I94bFOAD/Fh0lI5InxuctSGx8f0ZpOg0WI8 nyOmOFdoVHoqYVEQIHdvANTrx7FrxMplD69DotpGMQ5VUzre0HAVnQpqJS5XGl0pOji7 ZHQo+xflxxWwZetEJs4KDIRq33h2TgPsZk3tCshXdxv7Wi+8NaO4OgBoIQlJn1jYGJj7 Y6Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0+SHG0Pn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y22-20020a170902b49600b00174ef08284dsi13015519plr.336.2022.09.06.08.42.21; Tue, 06 Sep 2022 08:42:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0+SHG0Pn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S241017AbiIFOCC (ORCPT + 99 others); Tue, 6 Sep 2022 10:02:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240831AbiIFN6n (ORCPT ); Tue, 6 Sep 2022 09:58:43 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4BBD82D37; Tue, 6 Sep 2022 06:42:42 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id C4CFDCE177D; Tue, 6 Sep 2022 13:41:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94FE2C433D7; Tue, 6 Sep 2022 13:41:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1662471706; bh=8+kkAUlsHO/yNF6tJQWKq9mQcwOhlQDepvOfdAU3qdA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0+SHG0PnH2chNhfJiTJjc5h9YM8S0S1Bcg6+TVOQW1p/L3lpOGgQ6/LCAWOtCPU+K pNG7RBuIo1LMbzU3A/+JZFqcsJ/+uP/2ihQPzH3H3IL6iw5/hDQDHpVjhn1uU2dQzm FW66Dh8vptJxkBRVAHsjfieGvw5RrgCVe6EK+PSI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zeal Robot , Lv Ruyi , Iwona Winiarska , Sasha Levin Subject: [PATCH 5.19 011/155] peci: aspeed: fix error check return value of platform_get_irq() Date: Tue, 6 Sep 2022 15:29:19 +0200 Message-Id: <20220906132829.913662661@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220906132829.417117002@linuxfoundation.org> References: <20220906132829.417117002@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lv Ruyi [ Upstream commit e79b548b7202bb3accdfe64f113129a4340bc2f9 ] platform_get_irq() return negative value on failure, so null check of priv->irq is incorrect. Fix it by comparing whether it is less than zero. Fixes: a85e4c52086c ("peci: Add peci-aspeed controller driver") Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Link: https://lore.kernel.org/r/20220413010425.2534887-1-lv.ruyi@zte.com.cn Reviewed-by: Iwona Winiarska Signed-off-by: Iwona Winiarska Signed-off-by: Sasha Levin --- drivers/peci/controller/peci-aspeed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/peci/controller/peci-aspeed.c b/drivers/peci/controller/peci-aspeed.c index 1925ddc13f002..731c5d8f75c66 100644 --- a/drivers/peci/controller/peci-aspeed.c +++ b/drivers/peci/controller/peci-aspeed.c @@ -523,7 +523,7 @@ static int aspeed_peci_probe(struct platform_device *pdev) return PTR_ERR(priv->base); priv->irq = platform_get_irq(pdev, 0); - if (!priv->irq) + if (priv->irq < 0) return priv->irq; ret = devm_request_irq(&pdev->dev, priv->irq, aspeed_peci_irq_handler, -- 2.35.1