From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 48D5245895; Thu, 29 Aug 2024 11:01:05 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C1A5F42D8C; Thu, 29 Aug 2024 11:00:37 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) by mails.dpdk.org (Postfix) with ESMTP id 7C1F142D2B for ; Thu, 29 Aug 2024 11:00:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724922034; x=1756458034; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=eZWF65Yv0+EB1Gt7ePDi8x59sgivv3H2sXwrZl1pHeM=; b=St6LQkUyWr2G/obO6Qamte/LezIO9w/4MmvKIZ7tworA8Bv41+lAYYLR ZvcaMxjFjAJd9r3a1ACEvxScNnAwf5i7lg3QIqD5xYDkfTfpNqK+FLfS0 8AKgVEj0W/AMJdslVbScX8hqAeGXT07jgUqHB4NdpILBvLIUxHb7Dagpx L6P//GCc4cH+M1EeKOMfRIOnp5HJziO681g/ebeOwaGybVFzVatFLzXtr KQyFt8vXPDkhgMJyvdKvlFrIjXvAOe8odXyVdrI/G0kMWCfsNIUJJRgjm TlC9q9mAhJgZqkJXlPhNuIr6kUFX87W7HQrDjAuccbo82u7Ey2z64bOP3 g==; X-CSE-ConnectionGUID: ZgnS1R3MSeucz5MrF2T64Q== X-CSE-MsgGUID: 9ihVTu5nRMOTaJ7psIoo9w== X-IronPort-AV: E=McAfee;i="6700,10204,11178"; a="23663437" X-IronPort-AV: E=Sophos;i="6.10,185,1719903600"; d="scan'208";a="23663437" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2024 02:00:33 -0700 X-CSE-ConnectionGUID: b56xWNBSQsypV5BD3kKGFQ== X-CSE-MsgGUID: KETk2imgSXKB/D8pgwqCoA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,185,1719903600"; d="scan'208";a="64202945" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by orviesa008.jf.intel.com with ESMTP; 29 Aug 2024 02:00:32 -0700 From: Anatoly Burakov To: dev@dpdk.org Subject: [PATCH v1 06/15] net/ixgbe/base: fix unchecked return value Date: Thu, 29 Aug 2024 10:00:11 +0100 Message-ID: X-Mailer: git-send-email 2.43.5 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Barbara Skobiej There was unchecked return value in the ixgbe_stop_mac_link_on_d3_82599 function. Added checking of return value from the called function ixgbe_read_eeprom. Signed-off-by: Barbara Skobiej Signed-off-by: Anatoly Burakov --- drivers/net/ixgbe/base/ixgbe_82599.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/ixgbe/base/ixgbe_82599.c b/drivers/net/ixgbe/base/ixgbe_82599.c index c4ad906f0f..3110477700 100644 --- a/drivers/net/ixgbe/base/ixgbe_82599.c +++ b/drivers/net/ixgbe/base/ixgbe_82599.c @@ -556,13 +556,15 @@ enum ixgbe_media_type ixgbe_get_media_type_82599(struct ixgbe_hw *hw) **/ void ixgbe_stop_mac_link_on_d3_82599(struct ixgbe_hw *hw) { - u32 autoc2_reg; u16 ee_ctrl_2 = 0; + u32 autoc2_reg; + u32 status; DEBUGFUNC("ixgbe_stop_mac_link_on_d3_82599"); - ixgbe_read_eeprom(hw, IXGBE_EEPROM_CTRL_2, &ee_ctrl_2); + status = ixgbe_read_eeprom(hw, IXGBE_EEPROM_CTRL_2, &ee_ctrl_2); - if (!ixgbe_mng_present(hw) && !hw->wol_enabled && + if (status == IXGBE_SUCCESS && + !ixgbe_mng_present(hw) && !hw->wol_enabled && ee_ctrl_2 & IXGBE_EEPROM_CCD_BIT) { autoc2_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC2); autoc2_reg |= IXGBE_AUTOC2_LINK_DISABLE_ON_D3_MASK; -- 2.43.5