wil6210: fix potential null dereference of ndev before null check
authorColin Ian King <colin.king@canonical.com>
Wed, 28 Mar 2018 17:40:27 +0000 (18:40 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 10 Apr 2018 14:29:10 +0000 (17:29 +0300)
commitdb5a4d5e1073be452645d7021eeaf807d70325a2
tree5a04de7e17bda9cc432ab2c4076d55cd497e7b99
parent6707ba0105a2d350710bc0a537a98f49eb4b895d
wil6210: fix potential null dereference of ndev before null check

The pointer ndev is being dereferenced before it is being null checked,
hence there is a potential null pointer deference. Fix this by only
dereferencing ndev after it has been null checked

Detected by CoverityScan, CID#1467010 ("Dereference before null check")

Fixes: e00243fab84b ("wil6210: infrastructure for multiple virtual interfaces")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/wil6210/main.c