From: "Jürg Billeter" <j@bitron.ch>
To: Jens Axboe <axboe@fb.com>
Cc: linux-kernel@vger.kernel.org, "Jürg Billeter" <j@bitron.ch>
Subject: [PATCH] null_blk: fix blk_mq_init_queue() error handling
Date: Thu, 8 Jan 2015 11:04:16 +0100 [thread overview]
Message-ID: <1420711456-17257-1-git-send-email-j@bitron.ch> (raw)
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
next reply other threads:[~2015-01-08 10:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-08 10:04 Jürg Billeter [this message]
2015-01-08 15:07 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1420711456-17257-1-git-send-email-j@bitron.ch \
--to=j@bitron.ch \
--cc=axboe@fb.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®