]> www.infradead.org Git - users/hch/block.git/commitdiff
null_blk: add error handling support for add_disk() add-disk-error-handling
authorLuis Chamberlain <mcgrof@kernel.org>
Thu, 15 Jul 2021 19:51:40 +0000 (12:51 -0700)
committerChristoph Hellwig <hch@lst.de>
Wed, 18 Aug 2021 14:34:33 +0000 (16:34 +0200)
We never checked for errors on add_disk() as this function
returned void. Now that this is fixed, use the shiny new
error handling. The actual cleanup in case of error is
already handled by the caller of null_gendisk_register().

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/block/null_blk/main.c

index f128242d11701b155d365313a769662dc232dfed..187d779c8ca08232b036187036022a35e3822d8a 100644 (file)
@@ -1717,8 +1717,7 @@ static int null_gendisk_register(struct nullb *nullb)
                        return ret;
        }
 
-       add_disk(disk);
-       return 0;
+       return add_disk(disk);
 }
 
 static int null_init_tag_set(struct nullb *nullb, struct blk_mq_tag_set *set)