From: Colin Ian King Date: Thu, 6 Sep 2018 09:58:44 +0000 (+0100) Subject: cfg80211: remove redundant check of !scan_plan X-Git-Tag: Ubuntu-5.2.0-15.16~3224^2~88^2~35 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=6762696429bbc4b2e1b6e5996c3d99da8bbc627d;p=mirror_ubuntu-eoan-kernel.git cfg80211: remove redundant check of !scan_plan The check for !scan_plan is redunant as this has been checked in the proceeding statement and the code returns -ENOBUFS if it is true. Remove the redundant check. Signed-off-by: Colin Ian King Signed-off-by: Johannes Berg --- diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index d5f9b5235cdd..b4908bcb0d77 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -10690,8 +10690,7 @@ static int nl80211_send_wowlan_nd(struct sk_buff *msg, if (!scan_plan) return -ENOBUFS; - if (!scan_plan || - nla_put_u32(msg, NL80211_SCHED_SCAN_PLAN_INTERVAL, + if (nla_put_u32(msg, NL80211_SCHED_SCAN_PLAN_INTERVAL, req->scan_plans[i].interval) || (req->scan_plans[i].iterations && nla_put_u32(msg, NL80211_SCHED_SCAN_PLAN_ITERATIONS,