Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3972778pxb; Tue, 25 Jan 2022 00:20:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJxY3xXhwd5wzygEJ6OXJ9/nw7FFOaJV5JVopRML4YoGNg6R8CW51ATioyF9czf7MaGxCesz X-Received: by 2002:a05:6402:d0d:: with SMTP id eb13mr19458526edb.349.1643098838630; Tue, 25 Jan 2022 00:20:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643098838; cv=none; d=google.com; s=arc-20160816; b=ho0utiI7cyLwjIDxeoD4IIY8+LCPYRZaqnMwSAxULb8qC8EqS602C9UVaNZ+vP8EI+ DAr+wTwx7MwTEepPKQJbnfumh89Ev57lSUej6/TZm4BO0cfRHKiCnp2c9ssV+7zBRF1D nLb46MfyzJhmyeKeGfoqGMalkqmOeBNSZTqMzx48pVvnu0RRma+5ZkfwtYdZfJSqoru3 hODL++IR56fgHk8q3lTva0DtoB7s8INVMoTVHqbxzkm4B/B4967/NFcDPGfhhTddIZ8z oOSw+YZB1NCCAfeNYG75wXkXHPN1399uZWBfaDrKLc07y/uec6kqKznC2VXXjmL0f3+r 8Ntw== 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=JJaLZkF2G6FnOxdqzxPdZx1f+SNwax0CPBGfg2XgVRk=; b=UEJhZEwgv3RjNyW8f1L3kxquDv/7lNxOEHID2VsZ3eHhkgH6Bw1Vi4b7qzvkJZwi7Z B/taDLRILiDTidpNYfse0W+0q/11eY6RUrYfH/cmrXzFf4iF2MxDeWsjBr/XrLnIMfW3 OmEnsZGcoqY3j6XFaX0l0OCjQQeuusZPlXlURonFAzgb8bRGHp3aHVGA3KjjgfjkbyBY O82Mu1ERKWvcKnNnuYyjzAJtBzwiBmbVCfEt2H2vlqrEnInTFNVclVO7kjGmEn0yrW+z My1BtDh/1Xcfv4sGRPgj0H30CLlvHgdBgqRovBO1WBYwl/D102l/ipxoTwEPTsrFX+Zf L6rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iWBhZzXJ; 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 hc12si1566134ejc.210.2022.01.25.00.20.10; Tue, 25 Jan 2022 00:20:38 -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=iWBhZzXJ; 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 S3412389AbiAYAgt (ORCPT + 99 others); Mon, 24 Jan 2022 19:36:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2365364AbiAXXuq (ORCPT ); Mon, 24 Jan 2022 18:50:46 -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 1E480C0FE6A7; Mon, 24 Jan 2022 13:44:39 -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 B11C561491; Mon, 24 Jan 2022 21:44:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91751C340E4; Mon, 24 Jan 2022 21:44:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643060678; bh=CqvvbWfk9xwC8WTepgsm14BUMfW2AL5e1e4ceJFL41U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iWBhZzXJesCxojYqjf9lx32yL5ka+co20ZN7vQeUClCEwQ+b2iYFaMgJW8Vi7TUjG inxB5h5tKnEaR7pDkdh2DK4m5K/qHWt9CRb6x5cFpxAdV4XynoewUj2dyp0UdYPhLO aGqv1IeibNa2IX/qKBleI2AQL1nIztzEZ3GnWDYI= 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 5.16 1028/1039] lib82596: Fix IRQ check in sni_82596_probe Date: Mon, 24 Jan 2022 19:46:57 +0100 Message-Id: <20220124184159.847083815@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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 @@ -117,9 +117,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; }