Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed87ac09 authored by Wei Yongjun's avatar Wei Yongjun Committed by Jeff Kirsher
Browse files

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: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Tested-by: default avatarKavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 44bd741e
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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) {