From: Dan Carpenter Date: Fri, 18 Jun 2021 13:45:22 +0000 (+0300) Subject: blk-mq: fix an IS_ERR() vs NULL bug X-Git-Tag: v5.15~852^2~37 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=52d7e288444906aa5c99888e80a9cc1a1423ed92;p=platform%2Fkernel%2Flinux-starfive.git 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 Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/YMyjci35WBqrtqG+@mwanda Signed-off-by: Jens Axboe --- diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index 02a4aab..fd2de2b 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h @@ -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; \