Skip to contentSkip to conversation

null_blk: fix blk_mq_init_queue() error handling

PATCH In review Jürg Billeter 2 participants 2 messages Jan 8, 2015 Block layer

lore
Share & tools
lore
#0 lore raw

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

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

---
 drivers/block/null_blk.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/block/null_blk.c +2 -2
index ae9f615..727309c 100644
@@ -530,8 +530,8 @@ static int null_add_dev(void)
 			goto out_cleanup_queues;
 
 		nullb->q = blk_mq_init_queue(&nullb->tag_set);
-		if (!nullb->q) {
-			rv = -ENOMEM;
+		if (IS_ERR(nullb->q)) {
+			rv = PTR_ERR(nullb->q);
 			goto out_cleanup_tags;
 		}
 	} else if (queue_mode == NULL_Q_BIO) {
Signature · 1 line
2.2.1
#1 lore raw
Quoted 1 line · Jürg Billeter

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

This is fixed in for-linus, going upstream this week.

Signature · 1 line
Jens Axboe