public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] null_blk: fix blk_mq_init_queue() error handling
@ 2015-01-08 10:04 Jürg Billeter
  2015-01-08 15:07 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Jürg Billeter @ 2015-01-08 10:04 UTC (permalink / raw)
  To: Jens Axboe; +Cc: 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/null_blk.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c
index ae9f615..727309c 100644
--- a/drivers/block/null_blk.c
+++ b/drivers/block/null_blk.c
@@ -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) {
-- 
2.2.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] null_blk: fix blk_mq_init_queue() error handling
  2015-01-08 10:04 [PATCH] null_blk: fix blk_mq_init_queue() error handling Jürg Billeter
@ 2015-01-08 15:07 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2015-01-08 15:07 UTC (permalink / raw)
  To: Jürg Billeter; +Cc: linux-kernel

On 01/08/2015 03:04 AM, Jürg Billeter wrote:
> blk_mq_init_queue() returns ERR_PTR() on failure, not NULL.

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


-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-08 15:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-08 10:04 [PATCH] null_blk: fix blk_mq_init_queue() error handling Jürg Billeter
2015-01-08 15:07 ` Jens Axboe

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