Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

nl80211: check nla_nest_start() return value

Coverity pointed out that we might dereference NULL later
if nla_nest_start() returns a failure. This isn't really
true since we'd bomb out before, but we should check the
return value directly, so do that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>

+2
+2
net/wireless/nl80211.c
··· 11094 11094 struct nlattr *reasons; 11095 11095 11096 11096 reasons = nla_nest_start(msg, NL80211_ATTR_WOWLAN_TRIGGERS); 11097 + if (!reasons) 11098 + goto free_msg; 11097 11099 11098 11100 if (wakeup->disconnect && 11099 11101 nla_put_flag(msg, NL80211_WOWLAN_TRIG_DISCONNECT))