summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/virtual
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2023-08-22 15:17:21 +0300
committerJohannes Berg <johannes.berg@intel.com>2023-08-22 22:40:41 +0300
commit1b78dd34560e9962f8e917fe4adde6f2ab0eb89f (patch)
treed3376a74368cc653020261087bfd8997a0004952 /drivers/net/wireless/virtual
parenta7a2ef0c4b3efbd7d6f3fabd87dbbc0b3f2de5af (diff)
downloadlinux-1b78dd34560e9962f8e917fe4adde6f2ab0eb89f.tar.xz
Revert "wifi: mac80211_hwsim: check the return value of nla_put_u32"
This reverts commit b970ac68e0c4 ("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>
Diffstat (limited to 'drivers/net/wireless/virtual')
-rw-r--r--drivers/net/wireless/virtual/mac80211_hwsim.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/wireless/virtual/mac80211_hwsim.c b/drivers/net/wireless/virtual/mac80211_hwsim.c
index ec78fe13dd3e..1f524030b186 100644
--- a/drivers/net/wireless/virtual/mac80211_hwsim.c
+++ b/drivers/net/wireless/virtual/mac80211_hwsim.c
@@ -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);
}