mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-21 01:51:18 +00:00
hinic: Avoid some over memory allocation
[ Upstream commit15d221d0c3
] 'prod_idx' (atomic_t) is larger than 'shadow_idx' (u16), so some memory is over-allocated. Fixes:b15a9f37be
("net-next/hinic: Add wq") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
2ba52ad365
commit
90920566df
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue