]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/rxe: Fix the error caused by qp->sk
authorZhu Yanjun <yanjun.zhu@linux.dev>
Mon, 22 Aug 2022 01:16:14 +0000 (21:16 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 11:22:37 +0000 (13:22 +0200)
commit10cc06f2cc0893caf372b945f0ded58620829dea
tree83655f178eccd5ae85bf4749a1ba32db69bb7ab2
parent7cb58d9806886f885ac7b1846818013288241957
RDMA/rxe: Fix the error caused by qp->sk

[ Upstream commit 27b99f7d0eb7cc4d14eabbed5f0473e6068f6796 ]

When sock_create_kern in the function rxe_qp_init_req fails,
qp->sk is set to NULL.

Then the function rxe_create_qp will call rxe_qp_do_cleanup
to handle allocated resource.

Before handling qp->sk, this variable should be checked.

Fixes: c4397c211d7d ("Soft RoCE driver")
Link: https://lore.kernel.org/r/20220822011615.805603-3-yanjun.zhu@linux.dev
Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>
Reviewed-by: Bob Pearson <rpearsonhpe@gmail.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/sw/rxe/rxe_qp.c