Commit 5b0380cc authored by Yang Yingliang's avatar Yang Yingliang Committed by Zheng Zengkai
Browse files

hwmon: (ibmaem) don't call platform_device_del() if platform_device_add() fails

stable inclusion
from stable-v5.10.129
commit 14894cf6925c342047d3c63ca9c815a08b4685dc
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5YNDQ

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=14894cf6925c342047d3c63ca9c815a08b4685dc



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

[ Upstream commit d0e51022 ]

If platform_device_add() fails, it no need to call platform_device_del(), split
platform_device_unregister() into platform_device_del/put(), so platform_device_put()
can be called separately.

Fixes: 8808a793 ("ibmaem: new driver for power/energy/temp meters in IBM System X hardware")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220701074153.4021556-1-yangyingliang@huawei.com


Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: default avatarWei Li <liwei391@huawei.com>
parent e7b11649
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment