diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2014-11-05 15:39:09 -0500 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2014-11-05 15:47:03 -0500 |
commit | 9f173b33843552c48e0136e02e7362c8229c8e57 (patch) | |
tree | 8768a6e18323a1df32da8a9dfad2fb0dc179f67e /drivers/block | |
parent | a4aea5623d4a54682b6ff5c18196d7802f3e478f (diff) |
NVMe: blk_mq_alloc_request() returns error pointers
We recently converted this to blk_mq but the error checks have to be
updated to check for IS_ERR() instead of NULL.
Fixes: a4aea5623d4a ('NVMe: Convert to blk-mq')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/nvme-core.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c index 39050a3d10fd..f7a87173e3f0 100644 --- a/drivers/block/nvme-core.c +++ b/drivers/block/nvme-core.c | |||
@@ -826,8 +826,8 @@ static int nvme_submit_async_admin_req(struct nvme_dev *dev) | |||
826 | struct request *req; | 826 | struct request *req; |
827 | 827 | ||
828 | req = blk_mq_alloc_request(dev->admin_q, WRITE, GFP_KERNEL, false); | 828 | req = blk_mq_alloc_request(dev->admin_q, WRITE, GFP_KERNEL, false); |
829 | if (!req) | 829 | if (IS_ERR(req)) |
830 | return -ENOMEM; | 830 | return PTR_ERR(req); |
831 | 831 | ||
832 | cmd_info = blk_mq_rq_to_pdu(req); | 832 | cmd_info = blk_mq_rq_to_pdu(req); |
833 | nvme_set_info(cmd_info, req, async_req_completion); | 833 | nvme_set_info(cmd_info, req, async_req_completion); |
@@ -848,8 +848,8 @@ static int nvme_submit_admin_async_cmd(struct nvme_dev *dev, | |||
848 | struct nvme_cmd_info *cmd_rq; | 848 | struct nvme_cmd_info *cmd_rq; |
849 | 849 | ||
850 | req = blk_mq_alloc_request(dev->admin_q, WRITE, GFP_KERNEL, false); | 850 | req = blk_mq_alloc_request(dev->admin_q, WRITE, GFP_KERNEL, false); |
851 | if (!req) | 851 | if (IS_ERR(req)) |
852 | return -ENOMEM; | 852 | return PTR_ERR(req); |
853 | 853 | ||
854 | req->timeout = timeout; | 854 | req->timeout = timeout; |
855 | cmd_rq = blk_mq_rq_to_pdu(req); | 855 | cmd_rq = blk_mq_rq_to_pdu(req); |
@@ -1026,7 +1026,7 @@ static void nvme_abort_req(struct request *req) | |||
1026 | 1026 | ||
1027 | abort_req = blk_mq_alloc_request(dev->admin_q, WRITE, GFP_ATOMIC, | 1027 | abort_req = blk_mq_alloc_request(dev->admin_q, WRITE, GFP_ATOMIC, |
1028 | false); | 1028 | false); |
1029 | if (!abort_req) | 1029 | if (IS_ERR(abort_req)) |
1030 | return; | 1030 | return; |
1031 | 1031 | ||
1032 | abort_cmd = blk_mq_rq_to_pdu(abort_req); | 1032 | abort_cmd = blk_mq_rq_to_pdu(abort_req); |
@@ -1884,7 +1884,7 @@ static struct nvme_ns *nvme_alloc_ns(struct nvme_dev *dev, unsigned nsid, | |||
1884 | if (!ns) | 1884 | if (!ns) |
1885 | return NULL; | 1885 | return NULL; |
1886 | ns->queue = blk_mq_init_queue(&dev->tagset); | 1886 | ns->queue = blk_mq_init_queue(&dev->tagset); |
1887 | if (!ns->queue) | 1887 | if (IS_ERR(ns->queue)) |
1888 | goto out_free_ns; | 1888 | goto out_free_ns; |
1889 | queue_flag_set_unlocked(QUEUE_FLAG_NOMERGES, ns->queue); | 1889 | queue_flag_set_unlocked(QUEUE_FLAG_NOMERGES, ns->queue); |
1890 | queue_flag_set_unlocked(QUEUE_FLAG_NONROT, ns->queue); | 1890 | queue_flag_set_unlocked(QUEUE_FLAG_NONROT, ns->queue); |