diff options
| author | Yuan Can <yuancan@huawei.com> | 2022-11-23 06:12:12 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-01-18 11:30:26 +0100 |
| commit | 28652ffa73d4f5b70f16cbb4d043e730cacc6896 (patch) | |
| tree | dbfef77582ca90dbd073bfd47c7365ef9ad5f5f6 /drivers/misc | |
| parent | 1a0cbe9def6d616ed44b04e4db5c9238504f06d5 (diff) | |
serial: sunsab: Fix error handling in sunsab_init()
[ Upstream commit 1a6ec673fb627c26e2267ca0a03849f91dbd9b40 ]
The sunsab_init() returns the platform_driver_register() directly without
checking its return value, if platform_driver_register() failed, the
allocated sunsab_ports is leaked.
Fix by free sunsab_ports and set it to NULL when platform_driver_register()
failed.
Fixes: c4d37215a824 ("[SERIAL] sunsab: Convert to of_driver framework.")
Signed-off-by: Yuan Can <yuancan@huawei.com>
Link: https://lore.kernel.org/r/20221123061212.52593-1-yuancan@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/misc')
0 files changed, 0 insertions, 0 deletions
