mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-02 12:10:23 -04:00
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: Navid Emamdoost <navid.emamdoost@gmail.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
committed by
Jeff Kirsher
parent
621650cabe
commit
27d4613334
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user