mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-28 17:41:50 +00:00
IB/ehca: Check idr_find() return value
The idr_find() function may fail when trying to get the QP that is associated with a CQE, e.g. when a QP has been destroyed between the generation of a CQE and the poll request for it. In consequence, the return value of idr_find() must be checked and the CQE must be discarded when the QP cannot be found. Signed-off-by: Alexander Schmidt <alexs@linux.vnet.ibm.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
This commit is contained in:
parent
17c2b53adb
commit
129a10fb81
1 changed files with 3 additions and 1 deletions
|
@ -680,8 +680,10 @@ repoll:
|
||||||
|
|
||||||
read_lock(&ehca_qp_idr_lock);
|
read_lock(&ehca_qp_idr_lock);
|
||||||
my_qp = idr_find(&ehca_qp_idr, cqe->qp_token);
|
my_qp = idr_find(&ehca_qp_idr, cqe->qp_token);
|
||||||
wc->qp = &my_qp->ib_qp;
|
|
||||||
read_unlock(&ehca_qp_idr_lock);
|
read_unlock(&ehca_qp_idr_lock);
|
||||||
|
if (!my_qp)
|
||||||
|
goto repoll;
|
||||||
|
wc->qp = &my_qp->ib_qp;
|
||||||
|
|
||||||
wc->byte_len = cqe->nr_bytes_transferred;
|
wc->byte_len = cqe->nr_bytes_transferred;
|
||||||
wc->pkey_index = cqe->pkey_index;
|
wc->pkey_index = cqe->pkey_index;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue