net/mlx5: Devcom, fix error flow in mlx5_devcom_register_device
stable inclusion from stable-v5.10.181 commit d4d10a6df1529b3f446cdada5c25e065f4712756 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8GJZJ Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=d4d10a6df1529b3f446cdada5c25e065f4712756 -------------------------------- commit af871943 upstream. In case devcom allocation is failed, mlx5 is always freeing the priv. However, this priv might have been allocated by a different thread, and freeing it might lead to use-after-free bugs. Fix it by freeing the priv only in case it was allocated by the running thread. Fixes: fadd59fc ("net/mlx5: Introduce inter-device communication mechanism") Signed-off-by:Shay Drory <shayd@nvidia.com> Signed-off-by:
Saeed Mahameed <saeedm@nvidia.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
sanglipeng <sanglipeng1@jd.com>
Loading
Please sign in to comment