From: Dan Carpenter Date: Sat, 6 May 2017 00:48:35 +0000 (+0300) Subject: p54: allocate enough space for ->used_rxkeys X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c239838fbd6d5aadac193e02d0cf1866238da97b;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Kalle Valo --- diff --git a/drivers/net/wireless/intersil/p54/fwio.c b/drivers/net/wireless/intersil/p54/fwio.c index 4ac6764f4897..3076f646c829 100644 --- a/drivers/net/wireless/intersil/p54/fwio.c +++ b/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;