Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3976465pxb; Tue, 25 Jan 2022 00:26:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJyb0yOKesBxcWjXY3h5zAiNw9617et62S1IUt2AaXo3E2fidGMCr8SkYjtI6t07wc7D24Ad X-Received: by 2002:a05:6a00:1a15:b0:4c1:ec02:640 with SMTP id g21-20020a056a001a1500b004c1ec020640mr17598245pfv.81.1643099214941; Tue, 25 Jan 2022 00:26:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643099214; cv=none; d=google.com; s=arc-20160816; b=p6L5I/5XOEfENBfQ5F0ers+CoqbvJAlOBBz83Ys0PmgNLuakln0eyXPDOeImmJIxg/ 2vaLxIadRNnGI1MSPxhzvtD9ShI3duCIwi0Uj+nSrHlMSXz3qevYsI9USvccPIZs7D1N uMPzg5RkL0XcdsBdpIwQ7QcEziivEle1bwfyQTRmq/BcdR//gRCHRZ+YFYioenQzE7Tl FhtkX7gxQuBLLG3dUT8P8BHBXk+mHmqNMm+NW71Iwyra11P7gLJou4p4rOw4+kj89kfu xcvTs400JX+ZuUcqMF7Cqx0lEk5XOU2iau/Mbxnuj+6+G9or/XVc4xJewYS3ytqMtDry lu0w== 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=I94mB5eLyaMVhdqrgslh8NyWlFItjuNA5CjstkmaZDRS/tMlJgU9H6uTJzib7SQN5r QpajJOhAnAr1ekAH8jZBObpuIKFsu7mVkxJ/5xokpz3LYFG5c3wBrNwf9tqSc2hmcNPG 40vTLJN9APoTDwfT2sB9CJVGy777fx2l10McYroGfOih6vccKPRhHT0NrH8Qi+rfyHub jy1tOgAK2JX7KFutvPegKQBx44xQJl+jJGmzXw5ZaSr353Oa/M+dSo82hjh0+AcfSV+v VSgz0aj//MyGeRlChDcCPP6DvEAmSjdE7ync92ZwaBOddK/4nW+rtVgVyVLoNzLjzgqm Ivqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=U7IBz2xx; 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 j35si16231231pgm.138.2022.01.25.00.26.43; Tue, 25 Jan 2022 00:26:54 -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=U7IBz2xx; 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 S3421583AbiAYC1O (ORCPT + 99 others); Mon, 24 Jan 2022 21:27:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357622AbiAXTvE (ORCPT ); Mon, 24 Jan 2022 14:51:04 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CA81C019B22; Mon, 24 Jan 2022 11:24:06 -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 ams.source.kernel.org (Postfix) with ESMTPS id CA728B810BD; Mon, 24 Jan 2022 19:24:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EEFC9C340E5; Mon, 24 Jan 2022 19:24:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643052244; bh=/WuAenPvtHoOYxe2cLjzMTFFnpRHp7Hh7oLwX6A9/98=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U7IBz2xxnlE7JW5mKZ9tGtXyPaR73ch53Dmd+wXg+ngc0pYtNtn2VZimYn/hiKins Qp27xI5ewwuwz2GHMqe4ulAjy2RJRpu6x/TzxGNBBctVVwBtE0KtbraO/jpwLlBdZy XyhqELjop+L1UPX27RVNE7Sce5dmfO/C5/zhJvhw= 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.19 235/239] lib82596: Fix IRQ check in sni_82596_probe Date: Mon, 24 Jan 2022 19:44:33 +0100 Message-Id: <20220124183950.574194009@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183943.102762895@linuxfoundation.org> References: <20220124183943.102762895@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; }