mirror of
https://github.com/torvalds/linux.git
synced 2026-08-01 20:22:08 +02:00
net/mlx5: Fix memory leak in error flow of port set buffer
In the cited commit, shared buffer updates were added whenever
port buffer gets updated.
However, in case the shared buffer update fails, exiting early from
port_set_buffer() is performed without freeing previously-allocated memory.
Fix it by jumping to out label where memory is freed before returning
with error.
Fixes: a440030d89 ("net/mlx5e: Update shared buffer along with device buffer changes")
Signed-off-by: Maher Sanalla <msanalla@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
This commit is contained in:
parent
1e985a8d88
commit
e3e01c1c15
|
|
@ -314,11 +314,11 @@ static int port_set_buffer(struct mlx5e_priv *priv,
|
|||
err = port_update_shared_buffer(priv->mdev, current_headroom_size,
|
||||
new_headroom_size);
|
||||
if (err)
|
||||
return err;
|
||||
goto out;
|
||||
|
||||
err = port_update_pool_cfg(priv->mdev, port_buffer);
|
||||
if (err)
|
||||
return err;
|
||||
goto out;
|
||||
|
||||
err = mlx5e_port_set_pbmc(mdev, in);
|
||||
out:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user