nullb: fix error return code in null_init()
authorWei Yongjun <weiyongjun1@huawei.com>
Tue, 17 Oct 2017 12:11:46 +0000 (12:11 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Dec 2017 09:10:35 +0000 (10:10 +0100)
commitfc8f4ca137d9525b6f7db4b1d3e8f07a087518ec
tree1048cd35e71210ae7751ecba5addf351239fbe71
parentc97e41076a298dbc4e910c33048e553658388eed
nullb: fix error return code in null_init()

[ Upstream commit 30c516d750396c5f3ec9cb04c9e025c25e91495e ]

Fix to return error code -ENOMEM from the null_alloc_dev() error
handling case instead of 0, as done elsewhere in this function.

Fixes: 2984c8684f96 ("nullb: factor disk parameters")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/block/null_blk.c