Commit 27d46133 authored by Navid Emamdoost's avatar Navid Emamdoost Committed by Jeff Kirsher
Browse files

i40e: prevent memory leak in i40e_setup_macvlans



In i40e_setup_macvlans if i40e_setup_channel fails the allocated memory
for ch should be released.

Signed-off-by: default avatarNavid Emamdoost <navid.emamdoost@gmail.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 621650ca
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -7187,6 +7187,7 @@ static int i40e_setup_macvlans(struct i40e_vsi *vsi, u16 macvlan_cnt, u16 qcnt,
		ch->num_queue_pairs = qcnt;
		if (!i40e_setup_channel(pf, vsi, ch)) {
			ret = -EINVAL;
			kfree(ch);
			goto err_free;
		}
		ch->parent_vsi = vsi;