* [PATCH] hinic: Avoid some over memory allocation
@ 2022-05-21 6:33 Christophe JAILLET
2022-05-22 20:50 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2022-05-21 6:33 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Aviad Krawczyk, Zhao Chen
Cc: linux-kernel, kernel-janitors, Christophe JAILLET, netdev
'prod_idx' (atomic_t) is larger than 'shadow_idx' (u16), so some memory is
over-allocated.
Fixes: b15a9f37be2b ("net-next/hinic: Add wq")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/net/ethernet/huawei/hinic/hinic_hw_wq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_wq.c b/drivers/net/ethernet/huawei/hinic/hinic_hw_wq.c
index f7dc7d825f63..4daf6bf291ec 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_hw_wq.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_wq.c
@@ -386,7 +386,7 @@ static int alloc_wqes_shadow(struct hinic_wq *wq)
return -ENOMEM;
wq->shadow_idx = devm_kcalloc(&pdev->dev, wq->num_q_pages,
- sizeof(wq->prod_idx), GFP_KERNEL);
+ sizeof(*wq->shadow_idx), GFP_KERNEL);
if (!wq->shadow_idx)
goto err_shadow_idx;
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] hinic: Avoid some over memory allocation
2022-05-21 6:33 [PATCH] hinic: Avoid some over memory allocation Christophe JAILLET
@ 2022-05-22 20:50 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-05-22 20:50 UTC (permalink / raw)
To: Christophe JAILLET
Cc: davem, edumazet, kuba, pabeni, aviad.krawczyk, zhaochen6,
linux-kernel, kernel-janitors, netdev
Hello:
This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:
On Sat, 21 May 2022 08:33:01 +0200 you wrote:
> 'prod_idx' (atomic_t) is larger than 'shadow_idx' (u16), so some memory is
> over-allocated.
>
> Fixes: b15a9f37be2b ("net-next/hinic: Add wq")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> drivers/net/ethernet/huawei/hinic/hinic_hw_wq.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Here is the summary with links:
- hinic: Avoid some over memory allocation
https://git.kernel.org/netdev/net/c/15d221d0c345
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-05-22 20:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-21 6:33 [PATCH] hinic: Avoid some over memory allocation Christophe JAILLET
2022-05-22 20:50 ` patchwork-bot+netdevbpf
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).