提交 e8f90c74 编写于 作者: Y YueHaibing 提交者: Johannes Berg

mac80211_hwsim: fix a possible memory leak in hwsim_new_radio_nl()

'hwname' should be freed before leaving from the error handling cases,
otherwise it will cause mem leak

Fixes: cb1a5bae ("mac80211_hwsim: add permanent mac address option for new radios")
Signed-off-by: NYueHaibing <yuehaibing@huawei.com>
Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
上级 2f0605a6
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册