Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3556495pxb; Mon, 24 Jan 2022 12:08:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJyDfCEjPw4T6SXfdrDuJ/TPa0ppeikJbAKE48wsMkjvHFOR8GtBqSXrvzOLK55NO1r6w2qi X-Received: by 2002:a05:6a00:a8e:b0:4bd:265:def4 with SMTP id b14-20020a056a000a8e00b004bd0265def4mr15412651pfl.24.1643054927024; Mon, 24 Jan 2022 12:08:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643054927; cv=none; d=google.com; s=arc-20160816; b=XI87Z5coMEWaqiYbq1I8TCisNc1HAZ8JgP2ycydq3REdiKMy3PIzt9pF05gkAFoeZW Wet1X6BcFG+q5db2IXw+84EMzcenAiv3vG87tnKeUjQoMqa4COopYWWPAKGoEYsZVR1q s1EtZ4ZXNVOsg9vrOoUxVpUwZ871HmxRuKIcxOkCre4sLNcMcmsEmq4DRpvy4blP+nQe eSDbh7udfLG2058UUPFinsiHfx9wSP8QhV/Kx5ty6xJiLlQ8RIoLP08+Yda1ZjYum2Vl MsGQUvfP1N+5sOaM8ylt52xRk43j3zzS4Nd1/F02BlK1uZU5IDNPjLWrsnNa76ylHLoL CPUA== 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=zh/89mVTat8A8n+vRuDKqlNwqX5ycHmgF/GiUL2FtIKQeG398ExS8xTJnuCZ3PUMSi yTZc7oCTEnXLmIvIXB/QfgVkyjnoa5y2Y/2fQPxmGVYFQLWstdvt6OG/SPofzDLIcVNo X1Ia0H8qP6UURvSWAFKB05StCtPsE5D6vyaGY5Fo2Oi7EN7xEbOKqr/WRmR/Z1Cbt0af I7kMs2hGoxZahBfNXI53NFyWNNLyVnkFi+jpo9dhL3GgKMWwoW6pi0nB7GuHOpoeo3DZ itHJVYMhukxjd5d/ljn+Ef38eJmEa9hOPxyF6Qav6huPdwheXaH4kSk4C0pWD8PcyMr0 l24Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VEAExKlJ; 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 q13si2576979pfl.35.2022.01.24.12.08.32; Mon, 24 Jan 2022 12:08:47 -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=VEAExKlJ; 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 S236499AbiAXTJB (ORCPT + 99 others); Mon, 24 Jan 2022 14:09:01 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:57424 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344292AbiAXTBh (ORCPT ); Mon, 24 Jan 2022 14:01:37 -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 ams.source.kernel.org (Postfix) with ESMTPS id 16B2AB8124C; Mon, 24 Jan 2022 19:01:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B1DEC36AE3; Mon, 24 Jan 2022 19:01:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643050894; bh=/WuAenPvtHoOYxe2cLjzMTFFnpRHp7Hh7oLwX6A9/98=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VEAExKlJK+BY8HbC0FnodvMf8jWneI4MD0q3Lh71/s2VY7c3ghZLS8ys8OKgAHLXa UNndaEtCOYLHyR8FG6M3MNf3YP4dh9+dVPtaBT6PO5f1meY0JHfrBXgg527N8uRDeM YR3JkVMbIMr/dQcB8UlhNwHd1KWBfa6oOWCTkzrI= 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.9 145/157] lib82596: Fix IRQ check in sni_82596_probe Date: Mon, 24 Jan 2022 19:43:55 +0100 Message-Id: <20220124183937.364307472@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183932.787526760@linuxfoundation.org> References: <20220124183932.787526760@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; }