Commit e7afdd19 authored by Zhong Jinghua's avatar Zhong Jinghua Committed by Li Nan
Browse files

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: default avatarZhong Jinghua <zhongjinghua@huawei.com>
Signed-off-by: default avatarLi Nan <linan122@huawei.com>
parent f172bfbe
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment