summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLeo Kim <leo.kim@atmel.com>2016-02-22 04:11:50 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-22 19:47:00 (GMT)
commit396fa30e4b320f235c462f9d1b1f9da87548667a (patch)
tree62c342a6ae1377b1204d7fe3e12b594f0071b525 /drivers
parent2eaf35c1412a65139d5df677097cd6c6278f30b1 (diff)
downloadlinux-396fa30e4b320f235c462f9d1b1f9da87548667a.tar.xz
staging: wilc1000: removes potential null dereference
This patch removes the error reported by smatch. - wilc_wfi_cfgoperations.c:674 scan() error: potential null dereference 'strHiddenNetwork.net_info'. (kmalloc returns null) Signed-off-by: Leo Kim <leo.kim@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/wilc1000/wilc_wfi_cfgoperations.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 76f4375..8a3da2d 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -668,6 +668,8 @@ static int scan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
kmalloc_array(request->n_ssids,
sizeof(struct hidden_network),
GFP_KERNEL);
+ if (!strHiddenNetwork.net_info)
+ return -ENOMEM;
strHiddenNetwork.n_ssids = request->n_ssids;