diff options
author | Colin Ian King <colin.king@canonical.com> | 2016-09-05 18:24:38 +0300 |
---|---|---|
committer | Sagi Grimberg <sagi@grimberg.me> | 2016-09-12 22:29:42 +0300 |
commit | 1bda18de8f15a611a61d1a935b679db2e153338a (patch) | |
tree | b6857c838be60b5390c31aa1f42aa54a66328723 /drivers | |
parent | e87a911fed07e368c6f97e75152e6297a7dfba48 (diff) | |
download | linux-1bda18de8f15a611a61d1a935b679db2e153338a.tar.xz |
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: f5b7b559e1488 ("nvme-rdma: Get rid of duplicate variable")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/nvme/host/rdma.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c index d6bdf55a969e..c2c2c28e6eb5 100644 --- a/drivers/nvme/host/rdma.c +++ b/drivers/nvme/host/rdma.c @@ -293,6 +293,7 @@ static int nvme_rdma_reinit_request(void *data, struct request *rq) if (IS_ERR(req->mr)) { ret = PTR_ERR(req->mr); req->mr = NULL; + goto out; } req->mr->need_inval = false; |