Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Wei Yongjun and committed by
Jeff Kirsher
ed87ac09 44bd741e

+3 -1
+3 -1
drivers/net/ethernet/intel/i40e/i40e_main.c
··· 7204 7204 */ 7205 7205 len = sizeof(struct i40e_vsi *) * pf->hw.func_caps.num_vsis; 7206 7206 pf->vsi = kzalloc(len, GFP_KERNEL); 7207 - if (!pf->vsi) 7207 + if (!pf->vsi) { 7208 + err = -ENOMEM; 7208 7209 goto err_switch_setup; 7210 + } 7209 7211 7210 7212 err = i40e_setup_pf_switch(pf); 7211 7213 if (err) {