From: Markus Elfring <Markus.Elfring@web.de>
To: Navid Emamdoost <navid.emamdoost@gmail.com>,
intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org
Cc: Navid Emamdoost <emamd001@umn.edu>, Kangjie Lu <kjlu@umn.edu>,
Stephen A McCamant <smccaman@umn.edu>,
"David S. Miller" <davem@davemloft.net>,
Jeffrey Kirsher <jeffrey.t.kirsher@intel.com>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] i40e: prevent memory leak in i40e_setup_macvlans
Date: Fri, 27 Sep 2019 17:04:45 +0200 [thread overview]
Message-ID: <8d7d8cf4-c016-d22c-c2cc-dc71ea407cb4@web.de> (raw)
In-Reply-To: <20190925154831.19044-1-navid.emamdoost@gmail.com>
> 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
next prev parent reply other threads:[~2019-09-27 15:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-25 15:48 [PATCH] i40e: prevent memory leak in i40e_setup_macvlans Navid Emamdoost
2019-09-27 15:04 ` Markus Elfring [this message]
2019-09-27 19:01 ` [Intel-wired-lan] " Bowers, AndrewX
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8d7d8cf4-c016-d22c-c2cc-dc71ea407cb4@web.de \
--to=markus.elfring@web.de \
--cc=davem@davemloft.net \
--cc=emamd001@umn.edu \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jeffrey.t.kirsher@intel.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kjlu@umn.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=navid.emamdoost@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=smccaman@umn.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).