]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: (ibmaem) don't call platform_device_del() if platform_device_add() fails
authorYang Yingliang <yangyingliang@huawei.com>
Fri, 1 Jul 2022 07:41:53 +0000 (15:41 +0800)
committerGuenter Roeck <linux@roeck-us.net>
Fri, 1 Jul 2022 18:53:29 +0000 (11:53 -0700)
commit95ca002728cd315e9c638170b59532a1b7f20d30
tree082924672ec70b493e872d3b2783d17883b2c0b8
parentd06a9094f2e094c4a65b9c69469a0297b6cc56d6
hwmon: (ibmaem) don't call platform_device_del() if platform_device_add() fails

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: 5c0abd28a4fe ("ibmaem: new driver for power/energy/temp meters in IBM System X hardware")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220701074153.4021556-1-yangyingliang@huawei.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/ibmaem.c