From: Janani Ravichandran Date: Tue, 16 Feb 2016 22:24:52 +0000 (-0500) Subject: staging: wilc1000: Use kmalloc_array instead of kmalloc X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3e758b278896272bb641cd9e76e8416e2ba9586e;p=linux-beck.git staging: wilc1000: Use kmalloc_array instead of kmalloc Use kmalloc_array instead of kmalloc for arrays to prevent integer overflows. Signed-off-by: Janani Ravichandran Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 5649476fb8fd..cf351d1aa74b 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -664,7 +664,7 @@ static int scan(struct wiphy *wiphy, struct cfg80211_scan_request *request) PRINT_D(CFG80211_DBG, "Number of SSIDs %d\n", request->n_ssids); if (request->n_ssids >= 1) { - strHiddenNetwork.net_info = kmalloc(request->n_ssids * sizeof(struct hidden_network), GFP_KERNEL); + strHiddenNetwork.net_info = kmalloc_array(request->n_ssids, sizeof(struct hidden_network), GFP_KERNEL); strHiddenNetwork.n_ssids = request->n_ssids;