From: YueHaibing <yuehaibing-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
To: <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
Cc: <netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
<kvalo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
<linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
<ben.hutchings-4yDnlxn2s6sWdaTGBSpHTA@public.gmane.org>
Subject: Re: [PATCH] mac80211_hwsim: fix a possible memory leak in hwsim_new_radio_nl()
Date: Fri, 27 Apr 2018 14:28:36 +0800 [thread overview]
Message-ID: <b67cacdd-0dd6-0c24-e90e-4a2725862e87@huawei.com> (raw)
In-Reply-To: <20180424030835.21776-1-yuehaibing-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
cc Ben Hutchings <ben.hutchings-4yDnlxn2s6sWdaTGBSpHTA@public.gmane.org>
On 2018/4/24 11:08, YueHaibing wrote:
> 'hwname' should be freed before leaving from the error handling cases,
> otherwise it will cause mem leak
>
> Fixes: cb1a5bae5684 ("mac80211_hwsim: add permanent mac address option for new radios")
> Signed-off-by: YueHaibing <yuehaibing-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> ---
> drivers/net/wireless/mac80211_hwsim.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
> index 96d26cf..4a017a0 100644
> --- a/drivers/net/wireless/mac80211_hwsim.c
> +++ b/drivers/net/wireless/mac80211_hwsim.c
> @@ -3236,6 +3236,7 @@ static int hwsim_new_radio_nl(struct sk_buff *msg, struct genl_info *info)
> GENL_SET_ERR_MSG(info,"MAC is no valid source addr");
> NL_SET_BAD_ATTR(info->extack,
> info->attrs[HWSIM_ATTR_PERM_ADDR]);
> + kfree(hwname);
> return -EINVAL;
> }
>
>
prev parent reply other threads:[~2018-04-27 6:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-24 3:08 [PATCH] mac80211_hwsim: fix a possible memory leak in hwsim_new_radio_nl() YueHaibing
[not found] ` <20180424030835.21776-1-yuehaibing-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2018-04-27 6:28 ` YueHaibing [this message]
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=b67cacdd-0dd6-0c24-e90e-4a2725862e87@huawei.com \
--to=yuehaibing-hv44wf8li93qt0dzr+alfa@public.gmane.org \
--cc=ben.hutchings-4yDnlxn2s6sWdaTGBSpHTA@public.gmane.org \
--cc=johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org \
--cc=kvalo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/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