diff options
author | Maya Erez <merez@codeaurora.org> | 2016-06-09 09:07:50 +0300 |
---|---|---|
committer | Kyle Yan <kyan@codeaurora.org> | 2016-07-11 14:25:47 -0700 |
commit | 3299b78b6f009665b68479f9c6cfa62d23dbb472 (patch) | |
tree | 80e3af978f1369e5120ec8d75f945ae59d756a9a | |
parent | 6af6a921f701d1871e52d49b8d32177cd34d0f5d (diff) |
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.
Change-Id: Ib975c99b3b87998c357251a37f4862cbbf68697d
CRs-Fixed: 1026286
Signed-off-by: Maya Erez <merez@codeaurora.org>
-rw-r--r-- | drivers/net/wireless/ath/wil6210/p2p.c | 6 |
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); |