Commit 14f37d25 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Li Nan
Browse files

md: properly unwind when failing to add the kobject in md_alloc

mainline inclusion
from mainline-v5.16-rc1
commit 7ad10691
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I81XCK

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7ad1069166c0ccdd572d27e01cc7f7f84477df1e



--------------------------------

Add proper error handling to delete the gendisk when failing to add
the md kobject and clean up the error unwinding in general.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarSong Liu <songliubraving@fb.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>

Conflict:
	drivers/md/md.c
	Because add_disk_safe().

Signed-off-by: default avatarLi Nan <linan122@huawei.com>
parent 8999f7df
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment