Received: by 10.223.176.5 with SMTP id f5csp1028813wra; Fri, 2 Feb 2018 09:59:12 -0800 (PST) X-Google-Smtp-Source: AH8x227HgVRcdwKk9FC9Zqs5MURWtv5Kb71jOWRqP33aoMauBhDcxnXc+Nf5YeCINZFJRp7oDUF/ X-Received: by 10.99.96.144 with SMTP id u138mr4224743pgb.114.1517594352692; Fri, 02 Feb 2018 09:59:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517594352; cv=none; d=google.com; s=arc-20160816; b=vTTuBy9RgJhkWQtO6/u6Ubo9XQRsdOyE+5/jYn93WF6fXtYebv3uMYAu96aMyynY/X tmIGD9oDiCQ2AgGNi38B6xPNo/3GALkEt98Zi0CkpSdVy7+lUvsRLNLueU2HEfozaiI7 2OwY5wboaeYCETbNv/jTeI2ocR6KVrqjKzXUFhInELGpSoN87p6pn+J0sgNv48Ik2oVa 9ZIkn690C65MC0QMcevf6RfsF5pLCyRXN1Yc05ZPCvC045w6D+Xbh2ywQoSQDfoTsmNQ /jMWJSCwi8N53Ph/5n6A970KrsUKCOy7qYiTkmeVrZCoAtODHIdCvdmEpdtPRvQChAq/ qW7g== 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=WYxZfI3Ksdm/tBnbshKaCJWro3o1JgmeajAN+4kwQxg=; b=RQbaqrF+g7edNErRqzMon8FVSccLiSI3OS5StXmGkXKMNR7du5HO2KEaVAG462SBPq l/ynKEqE519RdNf8dHnLzyiJ94nljJATMVbA14+kPCuwXRpav08rn4Oolgpk3LU+U5vf eQM24uzI1/PIh3b9gUvlEByTvDJLMmNrCf4LDuT+8cmuz4aFjNYErZum9TMKibzaNLjM AmJh7CK2xfwwf3D4nKtTb7JkzgW8oqKAo7baUQxEEoG8bZv5ypdxLDQcGR5N8kjguCOb H5CSyPISOVa2Gi9+r3W0JKAZDyKSxYbsGXn5WwkL6uYFpYlPRnenjSFC3Tpt2lmo6w5P v+Uw== 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 v2si1701249pgs.511.2018.02.02.09.58.57; Fri, 02 Feb 2018 09:59:12 -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 S1753606AbeBBR4N (ORCPT + 99 others); Fri, 2 Feb 2018 12:56:13 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:38624 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752896AbeBBRLY (ORCPT ); Fri, 2 Feb 2018 12:11:24 -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 065D0F09; Fri, 2 Feb 2018 17:11:22 +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.14 095/156] bnxt_en: Fix an error handling path in bnxt_get_module_eeprom() Date: Fri, 2 Feb 2018 17:57:56 +0100 Message-Id: <20180202140844.526691239@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180202140840.242829545@linuxfoundation.org> References: <20180202140840.242829545@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.14-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 @@ -2133,8 +2133,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; }