From: Johannes Berg Date: Fri, 25 Oct 2013 09:16:58 +0000 (+0200) Subject: nl80211: check nla_nest_start() return value X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7fa322c878d70e38675f50e17acdce7fa3f5ac8c;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 --- diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index f1370ed9f498..e20c27ff0f14 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -11094,6 +11094,8 @@ void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev, struct nlattr *reasons; reasons = nla_nest_start(msg, NL80211_ATTR_WOWLAN_TRIGGERS); + if (!reasons) + goto free_msg; if (wakeup->disconnect && nla_put_flag(msg, NL80211_WOWLAN_TRIG_DISCONNECT))