mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] virtio_blk: fix blk_mq_init_queue() error handling
@ 2015-01-08 10:05 Jürg Billeter
  0 siblings, 0 replies; only message in thread
From: Jürg Billeter @ 2015-01-08 10:05 UTC (permalink / raw)
  To: Rusty Russell, Michael S. Tsirkin
  Cc: virtualization, linux-kernel, Jürg Billeter

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

Signed-off-by: Jürg Billeter <j@bitron.ch>
---
 drivers/block/virtio_blk.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 7ef7c09..b1b5c75 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -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;
 	}
 
-- 
2.2.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-01-08 10:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-08 10:05 [PATCH] virtio_blk: fix blk_mq_init_queue() error handling Jürg Billeter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®