Received: by 10.223.176.5 with SMTP id f5csp1022528wra; Fri, 2 Feb 2018 09:52:16 -0800 (PST) X-Google-Smtp-Source: AH8x227N1u+nFLBPOK3HwKsg91PoRY3KeFiIi/Q405qnj5Qpoz68JNj5gjZCbE39IdRtE/xxHd5s X-Received: by 10.99.116.23 with SMTP id p23mr32044684pgc.60.1517593936171; Fri, 02 Feb 2018 09:52:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517593936; cv=none; d=google.com; s=arc-20160816; b=kGTOhNxbeG0xcaP8CFSAmP+S3iF0h/BnQkL7EctDz1Q8mSouWyUjoyuVz4L1/DyKDI YK7iq1Ks52T4x1Hdf+Wb4bwvqvGiGmWVL09AgvYaUFb90KHqEUe+RJW6ZImPI2nq3Px8 +ZxI4btlhlhEFt6LbBg2IVJU8J06n4rTtASjov1reavyQkSFa4Lx13H02AI7b7h0oXyu 1GdGTNfywjf6wi1nb9bzM47oh+TAPbl6A9RMz7dS329ivPvmEOuVB1/k8zVbLIUtAdtl e7wXp842v245IF1pjT7TE93OFedMbxlnXkZ2CH1mcFriFX/N2GQLw8ql8SKbl0SkJ3Yt Dwrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=OkW1CoW2y6dAXllRFn0vbKZlO+DoE0sF9L7m0KxJw6I=; b=crm+CeaWVu0kUjfPXi9SQ+5CxtZy8PXJehUfrZYbnG3Z4qGveYHtD1GeNU7fMeiaWC /DIzd/68kuvG6Fk7CIAmD1mDEqQ/FlSEKWCwh9fQPplovMnvKPxGm4+Lw7Rax2p9Zddd ynrCFaUDbm0+gItOb2aPUKjRSDo+bFJ2+VLkIQJQYEk600ucJnlZFuEGEbOaNsoLDEdI jd3aUa6ZncGcve2+8wgc6+yaRAR71UhXbcbsblJTfcD4G01XfVF1aYPSSxAIwwPPwY7K 8lsmq5HaPluODBGp39HVC74Hk7+LJX7s2H39gY0fmlYT0RFlrsP0st6oPh/WjtIPPLSi aCPA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g189si257458pfc.386.2018.02.02.09.52.01; Fri, 02 Feb 2018 09:52:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753292AbeBBRMp (ORCPT + 99 others); Fri, 2 Feb 2018 12:12:45 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:36888 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752578AbeBBRGx (ORCPT ); Fri, 2 Feb 2018 12:06:53 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 8D542E3B; Fri, 2 Feb 2018 17:06:52 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , "David S. Miller" , Sasha Levin Subject: [PATCH 4.9 47/86] bnxt_en: Fix an error handling path in bnxt_get_module_eeprom() Date: Fri, 2 Feb 2018 17:58:07 +0100 Message-Id: <20180202140826.626849930@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180202140822.679101338@linuxfoundation.org> References: <20180202140822.679101338@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Christophe JAILLET [ Upstream commit dea521a2b9f96e905fa2bb2f95e23ec00c2ec436 ] Error code returned by 'bnxt_read_sfp_module_eeprom_info()' is handled a few lines above when reading the A0 portion of the EEPROM. The same should be done when reading the A2 portion of the EEPROM. In order to correctly propagate an error, update 'rc' in this 2nd call as well, otherwise 0 (success) is returned. Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c @@ -1843,8 +1843,8 @@ static int bnxt_get_module_eeprom(struct /* Read A2 portion of the EEPROM */ if (length) { start -= ETH_MODULE_SFF_8436_LEN; - bnxt_read_sfp_module_eeprom_info(bp, I2C_DEV_ADDR_A2, 1, start, - length, data); + rc = bnxt_read_sfp_module_eeprom_info(bp, I2C_DEV_ADDR_A2, 1, + start, length, data); } return rc; }