Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3563308pxb; Mon, 24 Jan 2022 12:17:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJydpbFec73CXcwMFUr8GJZ70KwGKrrconbspJ+A9bA9hFmleJz9JB4nWcATgRYtjaxcHSel X-Received: by 2002:a17:902:bd93:b0:149:ba01:e67a with SMTP id q19-20020a170902bd9300b00149ba01e67amr16114238pls.156.1643055473141; Mon, 24 Jan 2022 12:17:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643055473; cv=none; d=google.com; s=arc-20160816; b=Vszhex+ZTH9RHevWL490g9+Cy5VYDe2HgRKX+iay1dOdWrLCRUyuZ/ccOV5sNGmDBK m3M965ndIXIBsnZuw8E5/pxm2hCIfNwBOQ3pWomjt0C5vPsosIMU2B7pPlPmuyQw33mp JFjFbZA0UlwrsqcU0Ee2NBPVOh5EAmOgKAe+M13rYFE1ZtQZeaw3rrP63sBy5AKgAJPO bd970U35Yb6bDSb+uTqrzBd/1NL1Cta1kHzUaOX5n2Q8uzntanpnW2uxhlrJhP5Ts9FO 2UraDTZPcpo6ikq9crl/52FrV/z0ODwXPq6vzJiTsFL7SnJcQg2ODAYyD6Xl37N4axxf /Trg== 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=QhpR5SlKpuqFts82SpnhM1hlZ7fB68SAbOoovydUSgE=; b=fRQsezPgBOicFOHufEauLMOrB5dJGRtL22AfM9O3ZOP8BO9Tjbu+fF7HzSv1iS2j9O FdrugZXGACfLa9cPwhl9rWf8TOTYK92YhwkUPNg5I9aSa5HLMpZzCaI8ixXV74RVuRSX 0QZ8WUZgppkDHfC0H/2aEsafCMmsFt0mYTnhvqQyzHDNJk86C4t47OMdPOuY/VTPYxFW ZKWn6pZMfO8JEdQPIK2/Lj8kQaftmv+Perwa2zMyYG0u+UP1bpOAye/w5mTONOK9OXSL v2Rrd1/pcJV1stOQUlozHaZZMSNfD6AUHpx83WRZfFL29XYzLs0OKrltw2V53VNYwrwn qX+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=i1B2hcmr; 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 i7si14076535pgk.167.2022.01.24.12.17.40; Mon, 24 Jan 2022 12:17:53 -0800 (PST) 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=i1B2hcmr; 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 S1349166AbiAXTUX (ORCPT + 99 others); Mon, 24 Jan 2022 14:20:23 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:41504 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345572AbiAXTLz (ORCPT ); Mon, 24 Jan 2022 14:11:55 -0500 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 0859F60B88; Mon, 24 Jan 2022 19:11:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D801EC340E5; Mon, 24 Jan 2022 19:11:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643051514; bh=/WuAenPvtHoOYxe2cLjzMTFFnpRHp7Hh7oLwX6A9/98=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i1B2hcmrfZl/9itxVcIjxgloFuPEY+YmS6MwZoNDdqBliFMb6BGUdChLsYZkFEOyc 1n0mjCfyyixj4n1Gd6KNkemZ1vW/H3T2m4jtXyDORu6yeVBE7rKkT81thqfeD8yIYB nXVV1fAGura4qv9MKCA/JwKOhtYP1j7l03mWooQg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , "David S. Miller" Subject: [PATCH 4.14 179/186] lib82596: Fix IRQ check in sni_82596_probe Date: Mon, 24 Jan 2022 19:44:14 +0100 Message-Id: <20220124183942.866953540@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183937.101330125@linuxfoundation.org> References: <20220124183937.101330125@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: Miaoqian Lin commit 99218cbf81bf21355a3de61cd46a706d36e900e6 upstream. platform_get_irq() returns negative error number instead 0 on failure. And the doc of platform_get_irq() provides a usage example: int irq = platform_get_irq(pdev, 0); if (irq < 0) return irq; Fix the check of return value to catch errors correctly. Fixes: 115978859272 ("i825xx: Move the Intel 82586/82593/82596 based drivers") Signed-off-by: Miaoqian Lin Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/i825xx/sni_82596.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/net/ethernet/i825xx/sni_82596.c +++ b/drivers/net/ethernet/i825xx/sni_82596.c @@ -122,9 +122,10 @@ static int sni_82596_probe(struct platfo netdevice->dev_addr[5] = readb(eth_addr + 0x06); iounmap(eth_addr); - if (!netdevice->irq) { + if (netdevice->irq < 0) { printk(KERN_ERR "%s: IRQ not found for i82596 at 0x%lx\n", __FILE__, netdevice->base_addr); + retval = netdevice->irq; goto probe_failed; }