提交 437f8f9a 编写于 作者: M Matias Bjørling 提交者: Jens Axboe

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: NMatias Bjørling <m@bjorling.me>
Signed-off-by: NJens Axboe <axboe@fb.com>
上级 e9b76a80
...@@ -455,7 +455,7 @@ static void nvme_nvm_end_io(struct request *rq, int error) ...@@ -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_rq *rqd = rq->end_io_data;
struct nvm_dev *dev = rqd->dev; 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", pr_err("nvme: err status: %x result: %lx\n",
rq->errors, (unsigned long)rq->special); rq->errors, (unsigned long)rq->special);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册