summaryrefslogtreecommitdiff
path: root/drivers/nvme
diff options
context:
space:
mode:
authorMatias Bjørling <m@bjorling.me>2015-12-06 10:25:46 (GMT)
committerJens Axboe <axboe@fb.com>2015-12-07 16:14:19 (GMT)
commit437f8f9a1e923deab6c61822c36f29f4a2198cfe (patch)
tree65aef1e138b3ab6e5dbe53782e41dc8c9a8aa36e /drivers/nvme
parente9b76a80f1f165cb031f62128dc07d219e29f5a3 (diff)
downloadlinux-437f8f9a1e923deab6c61822c36f29f4a2198cfe.tar.xz
lightnvm: check mm before use
The core can may issue I/Os before a media manager is registered with the lightnvm subsystem. Make sure that we don't call the media manager ->end_io prematurely with a null pointer. Signed-off-by: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/nvme')
-rw-r--r--drivers/nvme/host/lightnvm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c
index 06c3364..762c9a7 100644
--- a/drivers/nvme/host/lightnvm.c
+++ b/drivers/nvme/host/lightnvm.c
@@ -455,7 +455,7 @@ static void nvme_nvm_end_io(struct request *rq, int error)
struct nvm_rq *rqd = rq->end_io_data;
struct nvm_dev *dev = rqd->dev;
- if (dev->mt->end_io(rqd, error))
+ if (dev->mt && dev->mt->end_io(rqd, error))
pr_err("nvme: err status: %x result: %lx\n",
rq->errors, (unsigned long)rq->special);