null_blk: fix ida error handling in null_add_dev()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 15 Jul 2022 08:12:14 +0000 (11:12 +0300)
committerJens Axboe <axboe@kernel.dk>
Tue, 2 Aug 2022 23:22:41 +0000 (17:22 -0600)
commitee452a8d984f94fa8e894f003a52e776e4572881
tree52f1d0ccc8a57447d922c0ef04582d27330a1f5b
parentc13cf14f44d23102f864a0d845439aa175631854
null_blk: fix ida error handling in null_add_dev()

There needs to be some error checking if ida_simple_get() fails.
Also call ida_free() if there are errors later.

Fixes: 94bc02e30fb8 ("nullb: use ida to manage index")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/YtEhXsr6vJeoiYhd@kili
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/null_blk/main.c