Commit 3e758b27 authored by Janani Ravichandran's avatar Janani Ravichandran Committed by Greg Kroah-Hartman

staging: wilc1000: Use kmalloc_array instead of kmalloc

Use kmalloc_array instead of kmalloc for arrays to prevent integer
overflows.
Signed-off-by: default avatarJanani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent aae96201
...@@ -664,7 +664,7 @@ static int scan(struct wiphy *wiphy, struct cfg80211_scan_request *request) ...@@ -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); PRINT_D(CFG80211_DBG, "Number of SSIDs %d\n", request->n_ssids);
if (request->n_ssids >= 1) { 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; strHiddenNetwork.n_ssids = request->n_ssids;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment