aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/wil6210
diff options
context:
space:
mode:
authorMaya Erez <qca_merez@qualcomm.com>2016-06-08 20:07:47 +0300
committerKalle Valo <kvalo@qca.qualcomm.com>2016-06-14 16:20:14 +0300
commit9c830abe9194871d6d2846f37930ef373356a016 (patch)
tree9774b88b4ff9ed514cb4c0774676e55a596b09da /drivers/net/wireless/ath/wil6210
parentath5k: fix misplaced default label in sifs switch (diff)
downloadlinux-dev-9c830abe9194871d6d2846f37930ef373356a016.tar.xz
linux-dev-9c830abe9194871d6d2846f37930ef373356a016.zip
wil6210: fix chan check in wil_p2p_listen
In wil_p2p_listen chan is checked to protect against NULL pointer access only before setting channel = chan->hw_value. Add a global parameter check to cover all accesses to chan. Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/wil6210')
-rw-r--r--drivers/net/wireless/ath/wil6210/p2p.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/wil6210/p2p.c b/drivers/net/wireless/ath/wil6210/p2p.c
index 1c9153894dca..213b8259638c 100644
--- a/drivers/net/wireless/ath/wil6210/p2p.c
+++ b/drivers/net/wireless/ath/wil6210/p2p.c
@@ -114,8 +114,10 @@ int wil_p2p_listen(struct wil6210_priv *wil, unsigned int duration,
u8 channel = P2P_DMG_SOCIAL_CHANNEL;
int rc;
- if (chan)
- channel = chan->hw_value;
+ if (!chan)
+ return -EINVAL;
+
+ channel = chan->hw_value;
wil_dbg_misc(wil, "%s: duration %d\n", __func__, duration);