diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2013-09-24 01:17:25 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2013-10-29 07:29:25 -0400 |
commit | ed87ac09d89129fa4d1f0a10d640fb6dabb46fcd (patch) | |
tree | 0c912e1aeb63b9c291d636b93bfea607de1962b0 /drivers/net/ethernet/intel | |
parent | 44bd741e10a5bc7d7dd14a79dd58f403819f43bd (diff) |
i40e: fix error return code in i40e_probe()
Fix to return -ENOMEM in the memory alloc error handling
case instead of 0, as done elsewhere in this function.
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel')
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_main.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 41a79df373d5..be15938ba213 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c | |||
@@ -7204,8 +7204,10 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
7204 | */ | 7204 | */ |
7205 | len = sizeof(struct i40e_vsi *) * pf->hw.func_caps.num_vsis; | 7205 | len = sizeof(struct i40e_vsi *) * pf->hw.func_caps.num_vsis; |
7206 | pf->vsi = kzalloc(len, GFP_KERNEL); | 7206 | pf->vsi = kzalloc(len, GFP_KERNEL); |
7207 | if (!pf->vsi) | 7207 | if (!pf->vsi) { |
7208 | err = -ENOMEM; | ||
7208 | goto err_switch_setup; | 7209 | goto err_switch_setup; |
7210 | } | ||
7209 | 7211 | ||
7210 | err = i40e_setup_pf_switch(pf); | 7212 | err = i40e_setup_pf_switch(pf); |
7211 | if (err) { | 7213 | if (err) { |