Skip to content

Commit 0c5fc92

Browse files
Qinglang Miaogregkh
authored andcommitted
serial: txx9: add missing platform_driver_unregister() on error in serial_txx9_init
Add the missing platform_driver_unregister() before return from serial_txx9_init in the error handling case when failed to register serial_txx9_pci_driver with macro ENABLE_SERIAL_TXX9_PCI defined. Fixes: ab4382d ("tty: move drivers/serial/ to drivers/tty/serial/") Signed-off-by: Qinglang Miao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 427627a commit 0c5fc92

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/tty/serial/serial_txx9.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,6 +1280,9 @@ static int __init serial_txx9_init(void)
12801280

12811281
#ifdef ENABLE_SERIAL_TXX9_PCI
12821282
ret = pci_register_driver(&serial_txx9_pci_driver);
1283+
if (ret) {
1284+
platform_driver_unregister(&serial_txx9_plat_driver);
1285+
}
12831286
#endif
12841287
if (ret == 0)
12851288
goto out;

0 commit comments

Comments
 (0)