]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:24:00 +0000 (14:24 +0200)
commit44a43c20657c843e89b3d51d3d80e03525692bbb
tree9b08b013f62fd41a42bc6da428b622e8ec6ce38d
parent53fc57fb7792f778a602ab1bf299c65f828a384c
null_blk: fix ida error handling in null_add_dev()

[ Upstream commit dddd4a1abd410d397a4eb517b64cd30e57d1a901 ]

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

Fixes: a4f42ad79f7f ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/block/null_blk/main.c