Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp891242rdb; Fri, 20 Oct 2023 02:26:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG/zvW4kiPt/gxYN7BnI5dThT5Nar6Gh2GtYBcnnQOgGJs/wsM2+INCIhDUvcnVc/yXXQhl X-Received: by 2002:a05:6870:6b89:b0:1e9:a8ff:67e8 with SMTP id ms9-20020a0568706b8900b001e9a8ff67e8mr1863723oab.50.1697793973863; Fri, 20 Oct 2023 02:26:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697793973; cv=none; d=google.com; s=arc-20160816; b=I8UqY8uqxL0bnLg9BrHN4/mnAHdEJvl0zgGKK83Y1p7TpzZyJDFo7o037p7twPKM0d jlZw52F+j1MCamm5wrLkihU5fNuTzP2YzelNFonu1Hc+I1Ly8Zp6GuPfuNYqn5tgJcKx V+Vv+ACzYbh5x0MydNpYyKZZAMCe2Ol3q2SX+LI8aXCIyyE1RNXeHaOCQ3FmRRUPoDxd VO0kd3bSwGUgBFphQS6LD2P8aozPMRk/yQK/sfMUoIdPmUE9b9d7qes9GuQVfyU3jNVp HYsOGfkgrQtw4ylgT41czoTEwPDozrG4hRTJt+S/20zyzekV/OWC8sOvpY5pFG/LfxuW LicA== 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 :message-id:date:subject:cc:to:from; bh=RfhqsiF8i/mCSjo5Vj4EF8xJi2MNDQ2xCpsdZxMOrog=; fh=uyDhXKxa/rf0YjbKyBdmhVxK3hnRpt9kmvO3F2+5fqw=; b=TH9p89rAPhaBVk9R7x8Rzla8ZXGEc1Cgahtwdw5jNuxqHmhqCxsoBnkHRuyE04glcL zGRN++YZMLgJKBnIAgLSFYelhq8tHGLOPiG3caPYwecCHjPTsBYHcG/9WcfvChNrCEAF 87YvfKjkBpgJqkeCbUpU7UHP/cBDHQuWamN1CP7YoYfyYktW6x9D0t8JO9OXHWYLdYa3 z5e/xoHN+BdwrI5aPpq9KExz3oyLRrYQLgJRClYoWXn2ROrrXm6rJjKR/002p8wiQCWx lwd3lS7KPrFODy4QX8Z5pn2Z0CEPU4QrrGo04//9eEYCTOV9NL1eEIRq0CVMpzXLJdJw mhfQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id f22-20020a637556000000b00573ffd25b44si1520628pgn.182.2023.10.20.02.26.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 02:26:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 58E6081C17A5; Fri, 20 Oct 2023 02:26:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376813AbjJTJZt (ORCPT + 99 others); Fri, 20 Oct 2023 05:25:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376811AbjJTJZe (ORCPT ); Fri, 20 Oct 2023 05:25:34 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 83D7219B1; Fri, 20 Oct 2023 02:25:06 -0700 (PDT) Received: from localhost.localdomain (unknown [180.167.10.98]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id 2B9B0604FCB31; Fri, 20 Oct 2023 17:25:01 +0800 (CST) X-MD-Sfrom: suhui@nfschina.com X-MD-SrcIP: 180.167.10.98 From: Su Hui To: jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: Su Hui , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] igb: e1000_82575: add an error code check in igb_set_d0_lplu_state_82575 Date: Fri, 20 Oct 2023 17:24:31 +0800 Message-Id: <20231020092430.209765-1-suhui@nfschina.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Fri, 20 Oct 2023 02:26:11 -0700 (PDT) igb_set_d0_lplu_state_82575() check all phy->ops.read_reg()'s return value except this one, just fix this. Signed-off-by: Su Hui --- drivers/net/ethernet/intel/igb/e1000_82575.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/intel/igb/e1000_82575.c b/drivers/net/ethernet/intel/igb/e1000_82575.c index 8d6e44ee1895..e765d5ee3661 100644 --- a/drivers/net/ethernet/intel/igb/e1000_82575.c +++ b/drivers/net/ethernet/intel/igb/e1000_82575.c @@ -978,6 +978,9 @@ static s32 igb_set_d0_lplu_state_82575(struct e1000_hw *hw, bool active) /* When LPLU is enabled, we should disable SmartSpeed */ ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_CONFIG, &data); + if (ret_val) + goto out; + data &= ~IGP01E1000_PSCFR_SMART_SPEED; ret_val = phy->ops.write_reg(hw, IGP01E1000_PHY_PORT_CONFIG, data); -- 2.30.2