Skip to content

Commit

Permalink
i40e: prevent memory leak in i40e_setup_macvlans
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Navidem authored and Jeff Kirsher committed Oct 25, 2019
1 parent 621650c commit 27d4613
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/ethernet/intel/i40e/i40e_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 27d4613

Please sign in to comment.