Skip to contentSkip to conversation

virtio_blk: fix blk_mq_init_queue() error handling

PATCH New Jürg Billeter 1 participant 1 message Jan 8, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virtio_blk: fix blk_mq_init_queue() error handling

blk_mq_init_queue() returns ERR_PTR() on failure, not NULL.

---
 drivers/block/virtio_blk.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/block/virtio_blk.c +2 -2
index 7ef7c09..b1b5c75 100644
@@ -638,8 +638,8 @@ static int virtblk_probe(struct virtio_device *vdev)
 		goto out_put_disk;
 
 	q = vblk->disk->queue = blk_mq_init_queue(&vblk->tag_set);
-	if (!q) {
-		err = -ENOMEM;
+	if (IS_ERR(q)) {
+		err = PTR_ERR(q);
 		goto out_free_tags;
 	}
 
Signature · 1 line
2.2.1