mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 22:26:55 +00:00
wifi: nl80211: Add checks for nla_nest_start() in nl80211_send_iface()
[ Upstream commit5cc58b3766
] As the nla_nest_start() may fail with NULL returned, the return value needs to be checked. Fixes:ce08cd344a
("wifi: nl80211: expose link information for interfaces") Signed-off-by: Yuan Can <yuancan@huawei.com> Link: https://lore.kernel.org/r/20221129014211.56558-1-yuancan@huawei.com Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
16784455e9
commit
82980218a9
1 changed files with 3 additions and 0 deletions
|
@ -3849,6 +3849,9 @@ static int nl80211_send_iface(struct sk_buff *msg, u32 portid, u32 seq, int flag
|
|||
for_each_valid_link(wdev, link_id) {
|
||||
struct nlattr *link = nla_nest_start(msg, link_id + 1);
|
||||
|
||||
if (!link)
|
||||
goto nla_put_failure;
|
||||
|
||||
if (nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID, link_id))
|
||||
goto nla_put_failure;
|
||||
if (nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN,
|
||||
|
|
Loading…
Reference in a new issue