diff options
author | Javier González <jg@lightnvm.io> | 2017-06-26 05:57:11 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2017-06-26 18:24:53 -0400 |
commit | 613fa267c3fa2bdf92d005a4d0fa911bc84f17f4 (patch) | |
tree | 9db9a0d7c16a6da3dfd03d194a69e434c686fd35 | |
parent | 3e505afb45f57e84adabf7a3b0b705c7b04ad59c (diff) |
lightnvm: propagate right error code to target
If nvme_alloc_request fails, propagate the right error, instead of
assuming ENOMEM.
Signed-off-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <matias@cnexlabs.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | drivers/nvme/host/lightnvm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c index e1ef8e9b41cb..be8541335e31 100644 --- a/drivers/nvme/host/lightnvm.c +++ b/drivers/nvme/host/lightnvm.c | |||
@@ -509,7 +509,7 @@ static int nvme_nvm_submit_io(struct nvm_dev *dev, struct nvm_rq *rqd) | |||
509 | rq = nvme_alloc_request(q, (struct nvme_command *)cmd, 0, NVME_QID_ANY); | 509 | rq = nvme_alloc_request(q, (struct nvme_command *)cmd, 0, NVME_QID_ANY); |
510 | if (IS_ERR(rq)) { | 510 | if (IS_ERR(rq)) { |
511 | kfree(cmd); | 511 | kfree(cmd); |
512 | return -ENOMEM; | 512 | return PTR_ERR(rq); |
513 | } | 513 | } |
514 | rq->cmd_flags &= ~REQ_FAILFAST_DRIVER; | 514 | rq->cmd_flags &= ~REQ_FAILFAST_DRIVER; |
515 | 515 | ||