提交 58901d18 编写于 作者: D Dan Carpenter 提交者: John W. Linville

brcmfmac: use kcalloc() to prevent integer overflow

The multiplication here looks like it could overflow.  I've changed it
to use kcalloc() to prevent that.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Acked-by: NArend van Spriel <arend@broadcom.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 365d2ebc
......@@ -3297,8 +3297,8 @@ brcmf_notify_sched_scan_results(struct brcmf_cfg80211_priv *cfg_priv,
int i;
request = kzalloc(sizeof(*request), GFP_KERNEL);
ssid = kzalloc(sizeof(*ssid) * result_count, GFP_KERNEL);
channel = kzalloc(sizeof(*channel) * result_count, GFP_KERNEL);
ssid = kcalloc(result_count, sizeof(*ssid), GFP_KERNEL);
channel = kcalloc(result_count, sizeof(*channel), GFP_KERNEL);
if (!request || !ssid || !channel) {
err = -ENOMEM;
goto out_err;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册