nvme-rdma: fix null pointer dereference on req->mr
authorColin Ian King <colin.king@canonical.com>
Mon, 5 Sep 2016 15:24:38 +0000 (16:24 +0100)
committerSagi Grimberg <sagi@grimberg.me>
Mon, 12 Sep 2016 19:29:42 +0000 (22:29 +0300)
commit1bda18de8f15a611a61d1a935b679db2e153338a
treeb6857c838be60b5390c31aa1f42aa54a66328723
parente87a911fed07e368c6f97e75152e6297a7dfba48
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>
drivers/nvme/host/rdma.c