Commit 52d7e288 authored by Dan Carpenter's avatar Dan Carpenter Committed by Jens Axboe

blk-mq: fix an IS_ERR() vs NULL bug

The __blk_mq_alloc_disk() function doesn't return NULLs it returns
error pointers.

Fixes: b461dfc4 ("blk-mq: add the blk_mq_alloc_disk APIs")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/YMyjci35WBqrtqG+@mwandaSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent e42cfb1d
...@@ -431,7 +431,7 @@ enum { ...@@ -431,7 +431,7 @@ enum {
static struct lock_class_key __key; \ static struct lock_class_key __key; \
struct gendisk *__disk = __blk_mq_alloc_disk(set, queuedata); \ struct gendisk *__disk = __blk_mq_alloc_disk(set, queuedata); \
\ \
if (__disk) \ if (!IS_ERR(__disk)) \
lockdep_init_map(&__disk->lockdep_map, \ lockdep_init_map(&__disk->lockdep_map, \
"(bio completion)", &__key, 0); \ "(bio completion)", &__key, 0); \
__disk; \ __disk; \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment