浏览代码

p54: allocate enough space for ->used_rxkeys

We have the number of longs, but we should be calculating the number of
bytes needed.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Dan Carpenter 8 年之前
父节点
当前提交
c239838fbd
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      drivers/net/wireless/intersil/p54/fwio.c

+ 3 - 2
drivers/net/wireless/intersil/p54/fwio.c

@@ -176,8 +176,9 @@ int p54_parse_firmware(struct ieee80211_hw *dev, const struct firmware *fw)
 		 * keeping a extra list for uploaded keys.
 		 */
 
-		priv->used_rxkeys = kzalloc(BITS_TO_LONGS(
-			priv->rx_keycache_size), GFP_KERNEL);
+		priv->used_rxkeys = kcalloc(BITS_TO_LONGS(priv->rx_keycache_size),
+					    sizeof(long),
+					    GFP_KERNEL);
 
 		if (!priv->used_rxkeys)
 			return -ENOMEM;