i40e: Fix a memory leak in X722 rss config path
authorAnjali Singhai <anjali.singhai@intel.com>
Mon, 24 Aug 2015 20:26:53 +0000 (13:26 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Sun, 4 Oct 2015 02:09:50 +0000 (19:09 -0700)
In any case free the memory allocated before exiting.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_main.c

index 4345fc58dc00677f09503cc179fa77cdf28970eb..5646ee885db24eb7ae42347c1129af6f165ef1cd 100644 (file)
@@ -7625,7 +7625,7 @@ static int i40e_config_rss_aq(struct i40e_vsi *vsi, const u8 *seed)
                         "Cannot set RSS key, err %s aq_err %s\n",
                         i40e_stat_str(&pf->hw, ret),
                         i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
-               return ret;
+               goto config_rss_aq_out;
        }
 
        if (vsi->type == I40E_VSI_MAIN)
@@ -7639,6 +7639,8 @@ static int i40e_config_rss_aq(struct i40e_vsi *vsi, const u8 *seed)
                         i40e_stat_str(&pf->hw, ret),
                         i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
 
+config_rss_aq_out:
+       kfree(rss_lut);
        return ret;
 }