Skip to content

Commit

Permalink
i40e: fix error return code in i40e_probe()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wei Yongjun authored and Jeff Kirsher committed Oct 29, 2013
1 parent 44bd741 commit ed87ac0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/ethernet/intel/i40e/i40e_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -7204,8 +7204,10 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
*/
len = sizeof(struct i40e_vsi *) * pf->hw.func_caps.num_vsis;
pf->vsi = kzalloc(len, GFP_KERNEL);
if (!pf->vsi)
if (!pf->vsi) {
err = -ENOMEM;
goto err_switch_setup;
}

err = i40e_setup_pf_switch(pf);
if (err) {
Expand Down

0 comments on commit ed87ac0

Please sign in to comment.