[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b67cacdd-0dd6-0c24-e90e-4a2725862e87@huawei.com>
Date: Fri, 27 Apr 2018 14:28:36 +0800
From: YueHaibing <yuehaibing@...wei.com>
To: <johannes@...solutions.net>
CC: <netdev@...r.kernel.org>, <kvalo@...eaurora.org>,
<linux-wireless@...r.kernel.org>, <ben.hutchings@...ethink.co.uk>
Subject: Re: [PATCH] mac80211_hwsim: fix a possible memory leak in
hwsim_new_radio_nl()
cc Ben Hutchings <ben.hutchings@...ethink.co.uk>
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@...wei.com>
> ---
> 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;
> }
>
>
Powered by blists - more mailing lists