Skip to content

Commit

Permalink
IB/rxe: Prevent from completer to operate on non valid QP
Browse files Browse the repository at this point in the history
On UD QP completer tasklet is scheduled for each packet sent.

If it is followed by a destroy_qp(), the kernel panic will
happen as the completer tries to operate on a destroyed QP.

Fixes: 8700e3e ("Soft RoCE driver")
Signed-off-by: Yonatan Cohen <yonatanc@mellanox.com>
Reviewed-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
  • Loading branch information
Yonatan Cohen authored and Doug Ledford committed Jan 24, 2017
1 parent f39f775 commit 2d4b21e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/infiniband/sw/rxe/rxe_qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -813,8 +813,7 @@ void rxe_qp_destroy(struct rxe_qp *qp)
del_timer_sync(&qp->rnr_nak_timer);

rxe_cleanup_task(&qp->req.task);
if (qp_type(qp) == IB_QPT_RC)
rxe_cleanup_task(&qp->comp.task);
rxe_cleanup_task(&qp->comp.task);

/* flush out any receive wr's or pending requests */
__rxe_do_task(&qp->req.task);
Expand Down

0 comments on commit 2d4b21e

Please sign in to comment.