Skip to content

Commit

Permalink
wifi: mac80211_hwsim: check the return value of nla_put_u32
Browse files Browse the repository at this point in the history
Check the return value of nla_put_u32() and handle it accordingly.

Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230604120651.de5168568cf6.Ie16442af9be879fd835506ba5dade780edecfb60@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Mukesh Sisodiya authored and Johannes Berg committed Jun 6, 2023
1 parent 29c6e2d commit b970ac6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/net/wireless/virtual/mac80211_hwsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,8 +582,9 @@ static int mac80211_hwsim_vendor_cmd_test(struct wiphy *wiphy,
*/

/* Add vendor data */
nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_TEST, val + 1);

err = nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_TEST, val + 1);
if (err)
return err;
/* Send the event - this will call nla_nest_end() */
cfg80211_vendor_event(skb, GFP_KERNEL);
}
Expand Down

0 comments on commit b970ac6

Please sign in to comment.