From 3e758b278896272bb641cd9e76e8416e2ba9586e Mon Sep 17 00:00:00 2001 From: Janani Ravichandran Date: Tue, 16 Feb 2016 17:24:52 -0500 Subject: [PATCH] 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 --- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.30.2