diff options
author | Bob Pearson <rpearsonhpe@gmail.com> | 2022-04-20 20:40:36 -0500 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2022-05-09 09:03:45 -0300 |
commit | 4e05a4b329e9416e5aded022feacde4385148f21 (patch) | |
tree | 0cc0c1e84b4648ee19949703fadb25f2f88c358c /drivers/infiniband/sw/rxe/rxe_comp.c | |
parent | b2a41678fc21fd39b11f5aca0a8c999f8efcb1a8 (diff) | |
download | linux-4e05a4b329e9416e5aded022feacde4385148f21.tar.gz linux-4e05a4b329e9416e5aded022feacde4385148f21.tar.bz2 linux-4e05a4b329e9416e5aded022feacde4385148f21.zip |
RDMA/rxe: Check rxe_get() return value
In the tasklets (completer, responder, and requester) check the return
value from rxe_get() to detect failures to get a reference. This only
occurs if the qp has had its reference count drop to zero which indicates
that it no longer should be used.
The ref is never 0 today because the tasklets are flushed before the ref
is dropped. The next patch changes this so that the ref is dropped then
the tasklets are flushed.
Link: https://lore.kernel.org/r/20220421014042.26985-4-rpearsonhpe@gmail.com
Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/infiniband/sw/rxe/rxe_comp.c')
-rw-r--r-- | drivers/infiniband/sw/rxe/rxe_comp.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/infiniband/sw/rxe/rxe_comp.c b/drivers/infiniband/sw/rxe/rxe_comp.c index 138b3e7d3a5f..da3a398053b8 100644 --- a/drivers/infiniband/sw/rxe/rxe_comp.c +++ b/drivers/infiniband/sw/rxe/rxe_comp.c @@ -562,7 +562,8 @@ int rxe_completer(void *arg) enum comp_state state; int ret = 0; - rxe_get(qp); + if (!rxe_get(qp)) + return -EAGAIN; if (!qp->valid || qp->req.state == QP_STATE_ERROR || qp->req.state == QP_STATE_RESET) { |