mirror of
https://github.com/hardkernel/linux.git
synced 2026-05-31 16:26:41 +09:00
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 <janani.rvchndrn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
aae9620151
commit
3e758b2788
@@ -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;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user