diff mbox series

[-next] RDMA/erdma: Fix return value check in erdma_alloc_ucontext()

Message ID 20220608021251.990364-1-weiyongjun1@huawei.com (mailing list archive)
State Not Applicable
Headers show
Series [-next] RDMA/erdma: Fix return value check in erdma_alloc_ucontext() | expand

Commit Message

Wei Yongjun June 8, 2022, 2:12 a.m. UTC
Fix the return value check which testing the wrong variable
in erdma_alloc_ucontext().

Fixes: c4612e83c14b ("RDMA/erdma: Add verbs implementation")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/infiniband/hw/erdma/erdma_verbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Cheng Xu June 8, 2022, 6:12 a.m. UTC | #1
On 6/8/22 10:12 AM, Wei Yongjun wrote:
> Fix the return value check which testing the wrong variable
> in erdma_alloc_ucontext().
> 
> Fixes: c4612e83c14b ("RDMA/erdma: Add verbs implementation")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>


Reviewed-by: Cheng Xu <chengyou@linux.alibaba.com>

Thanks.
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/erdma/erdma_verbs.c b/drivers/infiniband/hw/erdma/erdma_verbs.c
index 5516f7ee5f1e..1bb36b570c5d 100644
--- a/drivers/infiniband/hw/erdma/erdma_verbs.c
+++ b/drivers/infiniband/hw/erdma/erdma_verbs.c
@@ -1225,7 +1225,7 @@  int erdma_alloc_ucontext(struct ib_ucontext *ibctx, struct ib_udata *udata)
 
 	ctx->rq_db_mmap_entry = erdma_user_mmap_entry_insert(
 		ctx, (void *)ctx->rdb, PAGE_SIZE, ERDMA_MMAP_IO_NC, &uresp.rdb);
-	if (!ctx->sq_db_mmap_entry) {
+	if (!ctx->rq_db_mmap_entry) {
 		ret = -EINVAL;
 		goto err_out;
 	}