On Thu, Nov 19, 2026 at 01:57:31PM +0800, Yuqiang Sun wrote:
> ice_devlink_rate_node_new() allocates a scheduler node and stores it in
> the devlink rate as priv. When the parent is set, ice_devlink_set_parent()
> passes it to ice_sched_add_node() as prealloc_node. If allocating
> node->children fails, ice_sched_add_node() frees the node with
> devm_kfree(), but priv still points to it, and later rate operations
> (setting tx_max or tx_share, or setting the parent again) use the freed
> node.
> 
> Only free the node when ice_sched_add_node() allocated it.
> 
> Fixes: bdf96d965a20 ("ice: Add an option to pre-allocate memory for 
> ice_sched_node")
> Cc: [email protected]
> Signed-off-by: Yuqiang Sun <[email protected]>
> ---
> 
> Notes:
>     Bug was found by kbound, an internal static analysis prototype.
>     The fix was written with the help of Claude Opus 5.5.
>     
>     Compile-tested only (x86_64 and arm64 allmodconfig, W=1, sparse): I do
>     not have E800 hardware.

Reviewed-by: Simon Horman <[email protected]>

Reply via email to