提交 3e758b27 编写于 作者: J Janani Ravichandran 提交者: 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: NJanani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 aae96201
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册