diff options
| author | Yonatan Cohen <yonatanc@mellanox.com> | 2016-09-07 07:04:07 -0400 |
|---|---|---|
| committer | Doug Ledford <dledford@redhat.com> | 2016-09-16 14:14:08 -0400 |
| commit | c1cc72cb6ff95cbe02ed747866576dccab4a5911 (patch) | |
| tree | 760b7443960d74c7abd8f96758898be23754892e | |
| parent | 3050b99850247695cb07a5c15265afcc08bcf400 (diff) | |
IB/rxe: Fix kmem_cache leak
Decrement qp reference when handling error path
in completer to prevent kmem_cache leak.
Fixes: 8700e3e7c485 ("Soft RoCE driver")
Signed-off-by: Yonatan Cohen <yonatanc@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
| -rw-r--r-- | drivers/infiniband/sw/rxe/rxe_comp.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/infiniband/sw/rxe/rxe_comp.c b/drivers/infiniband/sw/rxe/rxe_comp.c index 36f67de44095..1c59ef2c67aa 100644 --- a/drivers/infiniband/sw/rxe/rxe_comp.c +++ b/drivers/infiniband/sw/rxe/rxe_comp.c | |||
| @@ -689,7 +689,14 @@ int rxe_completer(void *arg) | |||
| 689 | qp->req.need_retry = 1; | 689 | qp->req.need_retry = 1; |
| 690 | rxe_run_task(&qp->req.task, 1); | 690 | rxe_run_task(&qp->req.task, 1); |
| 691 | } | 691 | } |
| 692 | |||
| 693 | if (pkt) { | ||
| 694 | rxe_drop_ref(pkt->qp); | ||
| 695 | kfree_skb(skb); | ||
| 696 | } | ||
| 697 | |||
| 692 | goto exit; | 698 | goto exit; |
| 699 | |||
| 693 | } else { | 700 | } else { |
| 694 | wqe->status = IB_WC_RETRY_EXC_ERR; | 701 | wqe->status = IB_WC_RETRY_EXC_ERR; |
| 695 | state = COMPST_ERROR; | 702 | state = COMPST_ERROR; |
| @@ -716,6 +723,12 @@ int rxe_completer(void *arg) | |||
| 716 | case COMPST_ERROR: | 723 | case COMPST_ERROR: |
| 717 | do_complete(qp, wqe); | 724 | do_complete(qp, wqe); |
| 718 | rxe_qp_error(qp); | 725 | rxe_qp_error(qp); |
| 726 | |||
| 727 | if (pkt) { | ||
| 728 | rxe_drop_ref(pkt->qp); | ||
| 729 | kfree_skb(skb); | ||
| 730 | } | ||
| 731 | |||
| 719 | goto exit; | 732 | goto exit; |
| 720 | } | 733 | } |
| 721 | } | 734 | } |
