* [PATCH] p54: allocate enough space for ->used_rxkeys
@ 2017-05-06 0:48 Dan Carpenter
2017-05-22 15:31 ` Kalle Valo
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-05-06 0:48 UTC (permalink / raw)
To: Christian Lamparter; +Cc: Kalle Valo, linux-wireless, kernel-janitors
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>
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;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: p54: allocate enough space for ->used_rxkeys
2017-05-06 0:48 [PATCH] p54: allocate enough space for ->used_rxkeys Dan Carpenter
@ 2017-05-22 15:31 ` Kalle Valo
0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2017-05-22 15:31 UTC (permalink / raw)
To: Dan Carpenter; +Cc: Christian Lamparter, linux-wireless, kernel-janitors
Dan Carpenter <dan.carpenter@oracle.com> wrote:
> 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>
>
> 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;
Patch applied to wireless-drivers-next.git, thanks.
c239838fbd6d p54: allocate enough space for ->used_rxkeys
--
https://patchwork.kernel.org/patch/9714501/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-05-22 15:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-06 0:48 [PATCH] p54: allocate enough space for ->used_rxkeys Dan Carpenter
2017-05-22 15:31 ` Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).