]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/rxe: Fix error unwind in rxe_create_qp()
authorZhu Yanjun <yanjun.zhu@linux.dev>
Sun, 31 Jul 2022 06:36:21 +0000 (02:36 -0400)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 2 Aug 2022 17:29:41 +0000 (14:29 -0300)
commitc0e0fce5ef6bbcdee33f9f0acf97c9fae810ea44
tree6559c647787e18797d781bb87e08771c570f515b
parent3a2a4536bfddb0888a6739ef7327eca8f1ee53b8
RDMA/rxe: Fix error unwind in rxe_create_qp()

In the function rxe_create_qp(), rxe_qp_from_init() is called to
initialize qp, internally things like the spin locks are not setup until
rxe_qp_init_req().

If an error occures before this point then the unwind will call
rxe_cleanup() and eventually to rxe_qp_do_cleanup()/rxe_cleanup_task()
which will oops when trying to access the uninitialized spinlock.

Move the spinlock initializations earlier before any failures.

Fixes: c4397c211d7d ("Soft RoCE driver")
Link: https://lore.kernel.org/r/20220731063621.298405-1-yanjun.zhu@linux.dev
Reported-by: syzbot+833061116fa28df97f3b@syzkaller.appspotmail.com
Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/sw/rxe/rxe_qp.c