提交 1bda18de 编写于 作者: C Colin Ian King 提交者: Sagi Grimberg

nvme-rdma: fix null pointer dereference on req->mr

If there is an error on req->mr, req->mr is set to null, however
the following statement sets req->mr->need_inval causing a null
pointer dereference.  Fix this by bailing out to label 'out' to
immediately return and hence skip over the offending null pointer
dereference.

Fixes: f5b7b559 ("nvme-rdma: Get rid of duplicate variable")
Signed-off-by: NColin Ian King <colin.king@canonical.com>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NSagi Grimberg <sagi@grimberg.me>
上级 e87a911f
...@@ -293,6 +293,7 @@ static int nvme_rdma_reinit_request(void *data, struct request *rq) ...@@ -293,6 +293,7 @@ static int nvme_rdma_reinit_request(void *data, struct request *rq)
if (IS_ERR(req->mr)) { if (IS_ERR(req->mr)) {
ret = PTR_ERR(req->mr); ret = PTR_ERR(req->mr);
req->mr = NULL; req->mr = NULL;
goto out;
} }
req->mr->need_inval = false; req->mr->need_inval = false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册