HSI: omap_ssi_core: Fix error handling in ssi_init()
authorYuan Can <yuancan@huawei.com>
Thu, 24 Nov 2022 11:33:32 +0000 (11:33 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:14:32 +0000 (13:14 +0100)
commit30b191798fda0ceea524c33761c83516e804b119
tree8950c01ad55424bc1c040fc615bdaf735ff69ba7
parenta72fe8eb5555d6e80e252edeb4490f46675a0ea5
HSI: omap_ssi_core: Fix error handling in ssi_init()

[ Upstream commit 3ffa9f713c39a213a08d9ff13ab983a8aa5d8b5d ]

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

Fixes: 0fae198988b8 ("HSI: omap_ssi: built omap_ssi and omap_ssi_port into one module")
Signed-off-by: Yuan Can <yuancan@huawei.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hsi/controllers/omap_ssi_core.c