[dpdk-dev,05/36] ixgbe base codes: Fix early return

Message ID 1423742468-30404-6-git-send-email-changchun.ouyang@intel.com (mailing list archive)
State Accepted, archived
Headers

Commit Message

Ouyang Changchun Feb. 12, 2015, noon UTC
It could early return according to read status.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
---
 lib/librte_pmd_ixgbe/ixgbe/ixgbe_x550.c | 2 ++
 1 file changed, 2 insertions(+)
  

Patch

diff --git a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_x550.c b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_x550.c
index 76e9a32..84ab8b7 100644
--- a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_x550.c
+++ b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_x550.c
@@ -1060,6 +1060,8 @@  s32 ixgbe_setup_kr_x550em(struct ixgbe_hw *hw)
 	status = ixgbe_read_iosf_sb_reg_x550(hw,
 		IXGBE_KRM_LINK_CTRL_1(hw->phy.lan_id),
 		IXGBE_SB_IOSF_TARGET_KR_PHY, &reg_val);
+	if (status)
+		return status;
 
 	reg_val |= IXGBE_KRM_LINK_CTRL_1_TETH_AN_ENABLE;
 	reg_val |= IXGBE_KRM_LINK_CTRL_1_TETH_AN_FEC_REQ;