drbd: Fix double free problem in drbd_create_device
authorWu Bo <wubo40@huawei.com>
Thu, 4 Nov 2021 08:07:09 +0000 (16:07 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Jul 2022 14:35:00 +0000 (16:35 +0200)
commit5bb1df0bfd4640b47dc78290e2c6415cb79fc89b
treed6f5a8419c1660a0a621609f620bb89c07805f23
parentdbbcf21ad6a877caae6506ca54aa74967e6f0dbd
drbd: Fix double free problem in drbd_create_device

[ Upstream commit 27548088ac628109f70eb0b1eb521d035844dba8 ]

In drbd_create_device(), the 'out_no_io_page' lable has called
blk_cleanup_disk() when return failed.

So remove the 'out_cleanup_disk' lable to avoid double free the
disk pointer.

Fixes: e92ab4eda516 ("drbd: add error handling support for add_disk()")
Signed-off-by: Wu Bo <wubo40@huawei.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/1636013229-26309-1-git-send-email-wubo40@huawei.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/block/drbd/drbd_main.c