summaryrefslogtreecommitdiffstats
path: root/drivers/nvme
diff options
context:
space:
mode:
authorMatias Bjørling <m@bjorling.me>2016-11-28 22:38:52 +0100
committerJens Axboe <axboe@fb.com>2016-11-29 20:12:51 +0100
commit7498e99fc51ca60b960ef79061e0e7b521feb07e (patch)
tree07dc0f5c5f242347676262b3287869784a4f85ac /drivers/nvme
parentblk-mq: Drop explicit timeout sync in hotplug (diff)
downloadlinux-7498e99fc51ca60b960ef79061e0e7b521feb07e.tar.xz
linux-7498e99fc51ca60b960ef79061e0e7b521feb07e.zip
nvme: lightnvm: frees wrong cmd structure
When struct nvme_request was introduced, the nvme_nvm_submit_io was converted to the new interface. The interface moves nvme_nvm_command data structure into the struct request pdu. On io completion, rq->cmd is freed, which should have been the dereferenced pdu nvme_request->cmd. Fixes: d49187e97e94 "nvme: introduce struct nvme_request" 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 442f67774ea9..de3dc87226bb 100644
--- a/drivers/nvme/host/lightnvm.c
+++ b/drivers/nvme/host/lightnvm.c
@@ -477,7 +477,7 @@ static void nvme_nvm_end_io(struct request *rq, int error)
rqd->ppa_status = nvme_req(rq)->result.u64;
nvm_end_io(rqd, error);
- kfree(rq->cmd);
+ kfree(nvme_req(rq)->cmd);
blk_mq_free_request(rq);
}