scsi: sd: Clean up sdkp if device_add_disk() failed
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I81XCK ---------------------------------------- If device_add_disk fail, we should clear the resources requested by device_add, otherwise sdkp is not be cleared and will cause memory leaks. Fix it by call device_del to clean the sdkp. Fixes: 2a7a891f ("scsi: sd: Add error handling support for add_disk()") Signed-off-by:Zhong Jinghua <zhongjinghua@huawei.com> Signed-off-by:
Li Nan <linan122@huawei.com>
Loading
Please sign in to comment