blk-mq: fix an IS_ERR() vs NULL bug
Subsystems (2)
PATCH 1/1 blk-mq: fix an IS_ERR() vs NULL bug
The __blk_mq_alloc_disk() function doesn't return NULLs it returns error pointers.
Fixes b461dfc49eb6 ("blk-mq: add the blk_mq_alloc_disk APIs")
Signed-off-by Dan Carpenter <[email protected]>
--- include/linux/blk-mq.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/blk-mq.h +1 -1
@@ -431,7 +431,7 @@ enum {static struct lock_class_key __key; \struct gendisk *__disk =__blk_mq_alloc_disk (set, queuedata); \ \ -if (__disk) \ +if (!IS_ERR (__disk)) \lockdep_init_map (&__disk->lockdep_map, \"(bio completion)" , &__key,0 ); \ __disk; \
Signature · 1 line
2.30.2
Quoted 5 lines · Dan Carpenter
The
__blk_mq_alloc_disk()function doesn't return NULLs it returns error pointers.Fixes b461dfc49eb6 ("blk-mq: add the blk_mq_alloc_disk APIs")Signed-off-by Dan Carpenter <[email protected]>
Looks good,
Reviewed-by Christoph Hellwig <[email protected]>
Quoted 2 lines · Dan Carpenter
The
__blk_mq_alloc_disk()function doesn't return NULLs it returns error pointers.
Applied, thanks.
Signature · 1 line
Jens Axboe
Quoted 5 lines · Dan Carpenter
The
__blk_mq_alloc_disk()function doesn't return NULLs it returns error pointers.Fixes b461dfc49eb6 ("blk-mq: add the blk_mq_alloc_disk APIs")Signed-off-by Dan Carpenter <[email protected]>
Thanks for the fix, looks good.
Reviewed-by Chaitanya Kulkarni <[email protected]>