Skip to content

Commit

Permalink
Revert "wifi: mac80211_hwsim: check the return value of nla_put_u32"
Browse files Browse the repository at this point in the history
[ Upstream commit 1b78dd3 ]

This reverts commit b970ac6 ("wifi: mac80211_hwsim: check the
return value of nla_put_u32") since it introduced a memory leak in
the error path, which seems worse than sending an incomplete skb,
and the put can't fail anyway since the SKB was just allocated.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
jmberg-intel authored and gregkh committed Sep 23, 2023
1 parent 89a41ed commit a534434
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/net/wireless/virtual/mac80211_hwsim.c
Expand Up @@ -582,9 +582,8 @@ static int mac80211_hwsim_vendor_cmd_test(struct wiphy *wiphy,
*/

/* Add vendor data */
err = nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_TEST, val + 1);
if (err)
return err;
nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_TEST, val + 1);

/* Send the event - this will call nla_nest_end() */
cfg80211_vendor_event(skb, GFP_KERNEL);
}
Expand Down

0 comments on commit a534434

Please sign in to comment.