Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2144967iof; Tue, 7 Jun 2022 21:15:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEBljUxQjAuTJ35FpW39AhGoMSTN0fKNVXGxPIamZlCsVsjKsr7NC7c9SkKhU2VnMHy2af X-Received: by 2002:a17:90b:4f41:b0:1e4:9081:6aa with SMTP id pj1-20020a17090b4f4100b001e4908106aamr35111071pjb.183.1654661700402; Tue, 07 Jun 2022 21:15:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654661700; cv=none; d=google.com; s=arc-20160816; b=fMfs4WphHwpi5AJtSecYug2Wrx1wGSX8QDaLCccHrS/1xd6upns2XGSERO3R5LZGkX h6VQGIuWiEohaV/gAOVViv0JoEUM5psvkHXRZjO9qvvgWvQAfqbcHHN/j7ojaV147EPN c37RUz1SisA1j+1fBTEcoHVHeKo/1V985zXYzVNJubFFGuA/Zh+tI6jLtVjZF5NaWV2h W8WW3jfoW6ZEPqRwf2R1bxSVhC8s/UvPYPfkUJRoZ/ZjfTqBBeYrn+S24XazsA1eEwIC 9xF7pke1Qo1S2OWws55M0vHPa8OKNU+WqzRX8fRZGfizy+C6lMQLe/xSGwcX7yQWjh+B w56w== 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=mbXbMaf3NZkjIRCWyF1LQUgXYeAjCjlDIAaQ8B3Vobk=; b=qcJZi7wqS8/ObEFLc3Y6nv7vphnkspDIHwKudKgfJkel8UlcxAezELEjoxiZHPtUol P6EjezAf4xfHy8WNgP0WQDs4mRYmsTO2y5kUlsN8q9cimjt/oxU7hEbXmdGOuuHjh9T2 w41z7HrfpQKBMIdm7QUuc5od4qr9Vwcgg6ZUETW3w52ElMnV6LGzieOL6EWdM9pYX6US MyvV4ONI5h9D8ngLepU6VBvsoCkZzXeLOR+2NCLGKvgDaXmBnidH0PejkUl26Dc6eUWi bvxuqUNJsPyJJzeKknBJvyt6Ea28bztZa5ml00XtTf4zexvmXorHV96S3I0b21sXQe8f DXSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZDDhnC4y; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id jg6-20020a17090326c600b00161872d6f01si25515949plb.98.2022.06.07.21.15.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 21:15:00 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZDDhnC4y; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3333722EFF1; Tue, 7 Jun 2022 20:46:53 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380668AbiFGWdi (ORCPT + 99 others); Tue, 7 Jun 2022 18:33:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379116AbiFGVUC (ORCPT ); Tue, 7 Jun 2022 17:20:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BBC5169DCB; Tue, 7 Jun 2022 11:59:44 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 94710612F2; Tue, 7 Jun 2022 18:59:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9C246C385A2; Tue, 7 Jun 2022 18:59:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628380; bh=enDk63P51EW+pA7YZE3qadFlH+8bEQ6EbgSaATVfMHg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZDDhnC4yijarkzbkFEx8Z9nSCl6EsePjdpi51V6RRfm57nSbq0VOEucs4ISuT1xQZ eLgHvPYA+Zu5uQOVfzgVST7xkRt7r6peWS65W0jXTF9ONfZ7EKa26NtzR7pKfvp1cO ETEJCNEqXNEd4YKH6kGMn37eDo3kmLjmNKwEaRrk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zeal Robot , Lv Ruyi , Linus Walleij , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.18 308/879] ixp4xx_eth: fix error check return value of platform_get_irq() Date: Tue, 7 Jun 2022 18:57:06 +0200 Message-Id: <20220607165011.788341254@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 f45ba67eb74ab4b775616af731bdf8944afce3f1 ] platform_get_irq() return negative value on failure, so null check of return value is incorrect. Fix it by comparing whether it is less than zero. Fixes: 9055a2f59162 ("ixp4xx_eth: make ptp support a platform driver") Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20220412085126.2532924-1-lv.ruyi@zte.com.cn Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/xscale/ptp_ixp46x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/xscale/ptp_ixp46x.c b/drivers/net/ethernet/xscale/ptp_ixp46x.c index 1f382777aa5a..9abbdb71e629 100644 --- a/drivers/net/ethernet/xscale/ptp_ixp46x.c +++ b/drivers/net/ethernet/xscale/ptp_ixp46x.c @@ -271,7 +271,7 @@ static int ptp_ixp_probe(struct platform_device *pdev) ixp_clock.master_irq = platform_get_irq(pdev, 0); ixp_clock.slave_irq = platform_get_irq(pdev, 1); if (IS_ERR(ixp_clock.regs) || - !ixp_clock.master_irq || !ixp_clock.slave_irq) + ixp_clock.master_irq < 0 || ixp_clock.slave_irq < 0) return -ENXIO; ixp_clock.caps = ptp_ixp_caps; -- 2.35.1