Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by Simon Horman
Wed, 25 Nov 2026 10:38
Re: [PATCH v5 net 1/4] net: hns3: fix vector resource leak in hns3_nic_alloc_vector_data
Author: Simon Horman
Date: Wed, 25 Nov 2026 10:38
Date: Wed, 25 Nov 2026 10:38
28 lines
9131 bytes
9131 bytes
On Wed, Nov 18, 2026 at 09:03:27PM +0800, Jijie Shao wrote:
> When devm_kcalloc() fails for priv->tqp_vector after get_vector() has
> already acquired MSI-X vectors, the error path returns without calling
> put_vector() to release them, leaving the hclge/hclgevf bookkeeping
> (num_msi_used, num_msi_left, vector_status[]) inconsistent.
>
> Call put_vector() for every acquired vector before returning the error,
> and reset priv->vector_num to 0 so the count never describes vectors
> that were already handed back.
>
> Fixes: dd38c72604dc ("net: hns3: fix for coalesce configuration lost during reset")
> Signed-off-by: Jijie Shao <shaojijie@huawei.com>
> ---
> Changes in v4:
> - Correct the reason for resetting priv->vector_num. Sashiko pointed
> out that hns3_nic_dealloc_vector_data() is not reachable after
> hns3_nic_alloc_vector_data() fails, so the reset is not protecting
> that path; it keeps the count from describing vectors that were
> already handed back.
> v3: https://lore.kernel.org/all/20261030095633.377289-2-shaojijie@huawei.com/
> Changes in v3:
> - Simplify commit message: drop the accumulated-leak consequence
> paragraph and clarify that the vector_num reset avoids a NULL
> deref in hns3_nic_dealloc_vector_data().
> v2: https://lore.kernel.org/all/20261021121426.3096838-2-shaojijie@huawei.com/
Reviewed-by: Simon Horman <horms@kernel.org>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads