]> git.baikalelectronics.ru Git - kernel.git/commit
bus: sunxi-rsb: Fix error handling in sunxi_rsb_init()
authorYuan Can <yuancan@huawei.com>
Wed, 23 Nov 2022 09:42:00 +0000 (09:42 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Feb 2023 10:27:59 +0000 (11:27 +0100)
commit9cec0e43bdfeb2f79db098e0a842c6c90df1314c
tree7e895cc872b9a1f93688658fc9f97f98264edb93
parentedfae1c117b20820d3fa5c177e8450cfa7975625
bus: sunxi-rsb: Fix error handling in sunxi_rsb_init()

[ Upstream commit f71eaf2708be7831428eacae7db25d8ec6b8b4c5 ]

The sunxi_rsb_init() returns the platform_driver_register() directly
without checking its return value, if platform_driver_register() failed,
the sunxi_rsb_bus is not unregistered.
Fix by unregister sunxi_rsb_bus when platform_driver_register() failed.

Fixes: ef5ba27c1b01 ("bus: sunxi-rsb: Add driver for Allwinner Reduced Serial Bus")
Signed-off-by: Yuan Can <yuancan@huawei.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Link: https://lore.kernel.org/r/20221123094200.12036-1-yuancan@huawei.com
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/bus/sunxi-rsb.c