From: Qi Zhang Date: Mon, 15 Jun 2020 02:05:04 +0000 (+0800) Subject: net/ice/base: clear error status before set FC X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=f878b148653f774ab6655b2b3c91c2f7a517f898;hp=79d4730481c69ed1f1b93ad5261b70347f03194d;p=dpdk.git net/ice/base: clear error status before set FC ice_set_fc takes a u8 pointer 'aq_failures' as an input parameter. If this function encounters an error, in addition to returning an appropriate ice_status enum code, it also populates aq_failures with a link specific error value. If the caller does not initialize this variable to 0 before calling ice_set_fc, it would appear as if ice_set_fc returned an error code in this variable. So initialize it to 0. Signed-off-by: Anirudh Venkataramanan Signed-off-by: Paul M Stillwell Jr Signed-off-by: Qi Zhang Acked-by: Qiming Yang --- diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c index 8efc4b4cc4..d02a047f69 100644 --- a/drivers/net/ice/base/ice_common.c +++ b/drivers/net/ice/base/ice_common.c @@ -2637,6 +2637,7 @@ ice_set_fc(struct ice_port_info *pi, u8 *aq_failures, bool ena_auto_link_update) if (!pi || !aq_failures) return ICE_ERR_BAD_PTR; + *aq_failures = 0; hw = pi->hw; pcaps = (struct ice_aqc_get_phy_caps_data *)