net/qede/base: fix return code init of filter functions
authorRasesh Mody <rasesh.mody@cavium.com>
Tue, 7 Nov 2017 08:34:23 +0000 (00:34 -0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 7 Nov 2017 23:49:59 +0000 (00:49 +0100)
Fix for uninitialized scalar variable for filter APIs

Coverity issue: 1445717144571814457211445722
Fixes: 2e2f392b249a ("net/qede/base: upgrade the FW to 8.20.0.0")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
drivers/net/qede/base/ecore_dev.c

index e4bba17..da1830c 100644 (file)
@@ -4633,7 +4633,7 @@ enum _ecore_status_t ecore_llh_add_mac_filter(struct ecore_hwfn *p_hwfn,
                                          struct ecore_ptt *p_ptt, u8 *p_filter)
 {
        u32 high, low, entry_num;
-       enum _ecore_status_t rc;
+       enum _ecore_status_t rc = ECORE_SUCCESS;
 
        if (!OSAL_TEST_BIT(ECORE_MF_LLH_MAC_CLSS,
                           &p_hwfn->p_dev->mf_bits))
@@ -4657,7 +4657,7 @@ enum _ecore_status_t ecore_llh_add_mac_filter(struct ecore_hwfn *p_hwfn,
                   p_filter[0], p_filter[1], p_filter[2], p_filter[3],
                   p_filter[4], p_filter[5], entry_num);
 
-       return ECORE_SUCCESS;
+       return rc;
 }
 
 static enum _ecore_status_t
@@ -4701,7 +4701,7 @@ void ecore_llh_remove_mac_filter(struct ecore_hwfn *p_hwfn,
                             struct ecore_ptt *p_ptt, u8 *p_filter)
 {
        u32 high, low, entry_num;
-       enum _ecore_status_t rc;
+       enum _ecore_status_t rc = ECORE_SUCCESS;
 
        if (!OSAL_TEST_BIT(ECORE_MF_LLH_MAC_CLSS,
                           &p_hwfn->p_dev->mf_bits))
@@ -4776,11 +4776,11 @@ ecore_llh_add_protocol_filter(struct ecore_hwfn *p_hwfn,
                              enum ecore_llh_port_filter_type_t type)
 {
        u32 high, low, entry_num;
-       enum _ecore_status_t rc;
+       enum _ecore_status_t rc = ECORE_SUCCESS;
 
        if (!OSAL_TEST_BIT(ECORE_MF_LLH_PROTO_CLSS,
                           &p_hwfn->p_dev->mf_bits))
-               return ECORE_SUCCESS;
+               return rc;
 
        high = 0;
        low = 0;
@@ -4853,7 +4853,7 @@ ecore_llh_add_protocol_filter(struct ecore_hwfn *p_hwfn,
                break;
        }
 
-       return ECORE_SUCCESS;
+       return rc;
 }
 
 static enum _ecore_status_t
@@ -4920,7 +4920,7 @@ ecore_llh_remove_protocol_filter(struct ecore_hwfn *p_hwfn,
                                 enum ecore_llh_port_filter_type_t type)
 {
        u32 high, low, entry_num;
-       enum _ecore_status_t rc;
+       enum _ecore_status_t rc = ECORE_SUCCESS;
 
        if (!OSAL_TEST_BIT(ECORE_MF_LLH_PROTO_CLSS,
                           &p_hwfn->p_dev->mf_bits))