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: a440030d ("net/mlx5e: Update shared buffer along with device buffer changes") Signed-off-by: NMaher Sanalla <msanalla@nvidia.com> Reviewed-by: NMoshe Shemesh <moshe@nvidia.com> Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
Showing
想要评论请 注册 或 登录