[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8d7d8cf4-c016-d22c-c2cc-dc71ea407cb4@web.de>
Date: Fri, 27 Sep 2019 17:04:45 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: Navid Emamdoost <navid.emamdoost@...il.com>,
intel-wired-lan@...ts.osuosl.org, netdev@...r.kernel.org
Cc: Navid Emamdoost <emamd001@....edu>, Kangjie Lu <kjlu@....edu>,
Stephen A McCamant <smccaman@....edu>,
"David S. Miller" <davem@...emloft.net>,
Jeffrey Kirsher <jeffrey.t.kirsher@...el.com>,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] 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.
I suggest to improve also this change description.
> +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
> @@ -7168,6 +7168,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;
Can it matter to perform the added function call before the error code assignment?
Regards,
Markus
Powered by blists - more mailing lists