]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/mlx5: Fix memory leak in error flow for subscribe event routine
authorYongzhi Liu <lyz_cs@pku.edu.cn>
Fri, 11 Mar 2022 17:06:01 +0000 (09:06 -0800)
committerJason Gunthorpe <jgg@nvidia.com>
Mon, 14 Mar 2022 23:41:10 +0000 (20:41 -0300)
commit70c2b241773e9fe11a44239c3963d18cf7cb4e6f
tree9d3158c194380eb3f01cb28b81670bf6c7bcf01b
parent783710e6a32bab80dc136258f7216177f42f948b
RDMA/mlx5: Fix memory leak in error flow for subscribe event routine

In case the second xa_insert() fails, the obj_event is not released.  Fix
the error unwind flow to free that memory to avoid a memory leak.

Fixes: 9ea5beba79d1 ("IB/mlx5: Enable subscription for device events over DEVX")
Link: https://lore.kernel.org/r/1647018361-18266-1-git-send-email-lyz_cs@pku.edu.cn
Signed-off-by: Yongzhi Liu <lyz_cs@pku.edu.cn>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/mlx5/devx.c