Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3548867pxb; Mon, 24 Jan 2022 11:59:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJwPyywq1rVBVZ1yqpSvaJTTmvV9Bp+Q3U336reUXYnsvR17fpQfe8wdjVGTgQNzfZlS9l71 X-Received: by 2002:a17:902:cecc:b0:14b:48e0:ba5a with SMTP id d12-20020a170902cecc00b0014b48e0ba5amr7297831plg.146.1643054372704; Mon, 24 Jan 2022 11:59:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643054372; cv=none; d=google.com; s=arc-20160816; b=IqSll2IbBZazczferPR2M9cvoFe+fAuFD2tzvkdN/b+lVd3qS6W+dcgTQ1JAaSZok4 +8Y2fRN1Gt6D868S+vXQEO9YJAOCjQiKZR1cdvQZI+dFggd1R1TIC2+WiqNNz47LsB87 v9TABtNdCM2hAhT5ts9PUtgQwH7awRintT7x94dUbWMLYJ/YoSuNKvhXqkX+rHxUIJTC J3KTw6ezWRbz2sPBXawOdkvmLcltja/x3EwTNq66+O+4YEpcKhdrOgMfW4IHvUoqHVSq lRa3UI0jcCQ/xv+t5Ji+qvpIY8L395P23MYN6G7B6ZRVW5EvJ6mcyvHOFVCq1yGhgMjJ 6JdA== 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=f1N4q291H2LsdZqhBLrRBMICu6mOmbCjsGDoGUW/lQj2I2e/jVe0RIv5y7rvFfXzQP 7/5Lg18qqPpsGOOmbtkpwgfYS2CmB2P7AqK4PMpJM15gJcShsAr7D1nSkCJRTKqUekKo q6kD4RTaPf8/ci2Cjx01xIOBw4AnKqnL59rkVWDQE+6D07pGhietDCQX0dA3XozO5hl3 F2r/z6JjMlIknpPX6w/ai9C/LpKigTUqLJIwqOo/EX6mohfJuk5zLGjocXy92+vdm5/Q 8osNxFfc6QI35g2R7m1zGvznfPXQdAZVl6NqxVYlJ/rYynZ3jP5+f9LHbtMozNZSWUXf yqyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KC4CRU6w; 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 z1si14299083pgi.267.2022.01.24.11.59.20; Mon, 24 Jan 2022 11:59:32 -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=KC4CRU6w; 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 S1344394AbiAXS5X (ORCPT + 99 others); Mon, 24 Jan 2022 13:57:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344726AbiAXSzJ (ORCPT ); Mon, 24 Jan 2022 13:55:09 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 381E6C06136D; Mon, 24 Jan 2022 10:53:52 -0800 (PST) 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 CCA3261527; Mon, 24 Jan 2022 18:53:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 904D2C340E5; Mon, 24 Jan 2022 18:53:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643050431; bh=/WuAenPvtHoOYxe2cLjzMTFFnpRHp7Hh7oLwX6A9/98=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KC4CRU6wn+N4qqHAqGWYnjWMWWOhuWAySACWXbqjzXkrmnv4uA9plpsVgJSj1gy0S BBbAh0cd2PWglu/qL9Qsf0GQpDQl2KNF5ZRd3QQnbrnDf9UuKcvQNr1Uj37iSipBfz q5hxvoZBATTv/QY+8EOt8venHZUh21y95WCddMeY= 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.4 114/114] lib82596: Fix IRQ check in sni_82596_probe Date: Mon, 24 Jan 2022 19:43:29 +0100 Message-Id: <20220124183930.620954574@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183927.095545464@linuxfoundation.org> References: <20220124183927.095545464@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; }