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>
This commit is contained in:
Dan Carpenter 2017-05-06 03:48:35 +03:00 committed by Kalle Valo
parent e48d661eb1
commit c239838fbd

View file

@ -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;