linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] blk-mq: fix an IS_ERR() vs NULL bug
@ 2021-06-18 13:45 Dan Carpenter
  2021-06-18 14:07 ` Christoph Hellwig
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dan Carpenter @ 2021-06-18 13:45 UTC (permalink / raw)
  To: Jens Axboe, Christoph Hellwig
  Cc: Chaitanya Kulkarni, linux-block, kernel-janitors

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 <dan.carpenter@oracle.com>
---
 include/linux/blk-mq.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index 02a4aab0aeac..fd2de2b422ed 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;								\
-- 
2.30.2


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

* Re: [PATCH] blk-mq: fix an IS_ERR() vs NULL bug
  2021-06-18 13:45 [PATCH] blk-mq: fix an IS_ERR() vs NULL bug Dan Carpenter
@ 2021-06-18 14:07 ` Christoph Hellwig
  2021-06-18 14:53 ` Jens Axboe
  2021-06-19 23:02 ` Chaitanya Kulkarni
  2 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2021-06-18 14:07 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Jens Axboe, Christoph Hellwig, Chaitanya Kulkarni, linux-block,
	kernel-janitors

On Fri, Jun 18, 2021 at 04:45:22PM +0300, Dan Carpenter wrote:
> 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 <dan.carpenter@oracle.com>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

* Re: [PATCH] blk-mq: fix an IS_ERR() vs NULL bug
  2021-06-18 13:45 [PATCH] blk-mq: fix an IS_ERR() vs NULL bug Dan Carpenter
  2021-06-18 14:07 ` Christoph Hellwig
@ 2021-06-18 14:53 ` Jens Axboe
  2021-06-19 23:02 ` Chaitanya Kulkarni
  2 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2021-06-18 14:53 UTC (permalink / raw)
  To: Dan Carpenter, Christoph Hellwig
  Cc: Chaitanya Kulkarni, linux-block, kernel-janitors

On 6/18/21 7:45 AM, Dan Carpenter wrote:
> The __blk_mq_alloc_disk() function doesn't return NULLs it returns
> error pointers.

Applied, thanks.

-- 
Jens Axboe


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

* Re: [PATCH] blk-mq: fix an IS_ERR() vs NULL bug
  2021-06-18 13:45 [PATCH] blk-mq: fix an IS_ERR() vs NULL bug Dan Carpenter
  2021-06-18 14:07 ` Christoph Hellwig
  2021-06-18 14:53 ` Jens Axboe
@ 2021-06-19 23:02 ` Chaitanya Kulkarni
  2 siblings, 0 replies; 4+ messages in thread
From: Chaitanya Kulkarni @ 2021-06-19 23:02 UTC (permalink / raw)
  To: Dan Carpenter, Jens Axboe, Christoph Hellwig; +Cc: linux-block, kernel-janitors

On 6/18/21 06:45, Dan Carpenter wrote:
> 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 <dan.carpenter@oracle.com>

Thanks for the fix, looks good.

Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>


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

end of thread, other threads:[~2021-06-19 23:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-18 13:45 [PATCH] blk-mq: fix an IS_ERR() vs NULL bug Dan Carpenter
2021-06-18 14:07 ` Christoph Hellwig
2021-06-18 14:53 ` Jens Axboe
2021-06-19 23:02 ` Chaitanya Kulkarni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).