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>
This commit is contained in:
Leo Kim 2016-02-22 13:11:50 +09:00 committed by Greg Kroah-Hartman
parent 2eaf35c141
commit 396fa30e4b

View file

@ -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;