Commit fd5382c
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: 8700e3e ("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>1 parent c977645 commit fd5382c
1 file changed
Lines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
175 | 183 | | |
176 | 184 | | |
177 | 185 | | |
| |||
232 | 240 | | |
233 | 241 | | |
234 | 242 | | |
235 | | - | |
236 | 243 | | |
237 | 244 | | |
238 | 245 | | |
| |||
283 | 290 | | |
284 | 291 | | |
285 | 292 | | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | 293 | | |
290 | 294 | | |
291 | 295 | | |
| |||
0 commit comments