From: Javier González Date: Mon, 26 Jun 2017 09:57:11 +0000 (+0200) Subject: lightnvm: propagate right error code to target X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=613fa267c3fa2bdf92d005a4d0fa911bc84f17f4;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe --- 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) rq = nvme_alloc_request(q, (struct nvme_command *)cmd, 0, NVME_QID_ANY); if (IS_ERR(rq)) { kfree(cmd); - return -ENOMEM; + return PTR_ERR(rq); } rq->cmd_flags &= ~REQ_FAILFAST_DRIVER;