mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-15 11:44:11 +00:00
HSI: omap_ssi_core: Fix error handling in ssi_init()
[ Upstream commit3ffa9f713c
] 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:0fae198988
("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>
This commit is contained in:
parent
9a6e76b5af
commit
4199c3e353
1 changed files with 7 additions and 1 deletions
|
@ -631,7 +631,13 @@ static int __init ssi_init(void) {
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
return platform_driver_register(&ssi_port_pdriver);
|
||||
ret = platform_driver_register(&ssi_port_pdriver);
|
||||
if (ret) {
|
||||
platform_driver_unregister(&ssi_pdriver);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
module_init(ssi_init);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue