diff options
author | Ming Lei <ming.lei@canonical.com> | 2015-01-02 09:25:27 -0500 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2015-01-02 12:32:02 -0500 |
commit | 35b489d32fcc37e8735f41aa794b24cf9d1e74f5 (patch) | |
tree | f16c4c7a3148a3ca9c7c149ea6de66fd4423e7c8 /drivers/block | |
parent | aed3ea94bdd2ac0a21ed0103d34097e202ee77f6 (diff) |
block: fix checking return value of blk_mq_init_queue
Check IS_ERR_OR_NULL(return value) instead of just return value.
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Reduced to IS_ERR() by me, we never return NULL.
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/null_blk.c | 2 | ||||
-rw-r--r-- | drivers/block/nvme-core.c | 2 | ||||
-rw-r--r-- | drivers/block/virtio_blk.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c index ae9f615382f6..aa2224aa7caa 100644 --- a/drivers/block/null_blk.c +++ b/drivers/block/null_blk.c | |||
@@ -530,7 +530,7 @@ static int null_add_dev(void) | |||
530 | goto out_cleanup_queues; | 530 | goto out_cleanup_queues; |
531 | 531 | ||
532 | nullb->q = blk_mq_init_queue(&nullb->tag_set); | 532 | nullb->q = blk_mq_init_queue(&nullb->tag_set); |
533 | if (!nullb->q) { | 533 | if (IS_ERR(nullb->q)) { |
534 | rv = -ENOMEM; | 534 | rv = -ENOMEM; |
535 | goto out_cleanup_tags; | 535 | goto out_cleanup_tags; |
536 | } | 536 | } |
diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c index 52d0f2d9fecd..f7d083bb3bd5 100644 --- a/drivers/block/nvme-core.c +++ b/drivers/block/nvme-core.c | |||
@@ -1376,7 +1376,7 @@ static int nvme_alloc_admin_tags(struct nvme_dev *dev) | |||
1376 | return -ENOMEM; | 1376 | return -ENOMEM; |
1377 | 1377 | ||
1378 | dev->admin_q = blk_mq_init_queue(&dev->admin_tagset); | 1378 | dev->admin_q = blk_mq_init_queue(&dev->admin_tagset); |
1379 | if (!dev->admin_q) { | 1379 | if (IS_ERR(dev->admin_q)) { |
1380 | blk_mq_free_tag_set(&dev->admin_tagset); | 1380 | blk_mq_free_tag_set(&dev->admin_tagset); |
1381 | return -ENOMEM; | 1381 | return -ENOMEM; |
1382 | } | 1382 | } |
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 7ef7c098708f..cdfbd21e3597 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c | |||
@@ -638,7 +638,7 @@ static int virtblk_probe(struct virtio_device *vdev) | |||
638 | goto out_put_disk; | 638 | goto out_put_disk; |
639 | 639 | ||
640 | q = vblk->disk->queue = blk_mq_init_queue(&vblk->tag_set); | 640 | q = vblk->disk->queue = blk_mq_init_queue(&vblk->tag_set); |
641 | if (!q) { | 641 | if (IS_ERR(q)) { |
642 | err = -ENOMEM; | 642 | err = -ENOMEM; |
643 | goto out_free_tags; | 643 | goto out_free_tags; |
644 | } | 644 | } |