serial: txx9: add missing platform_driver_unregister() on error in serial_txx9_init
authorQinglang Miao <miaoqinglang@huawei.com>
Tue, 3 Nov 2020 08:49:42 +0000 (16:49 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Nov 2020 09:29:06 +0000 (10:29 +0100)
commitbe96acc7c1f6b1810d37382bfc3b57621d79972a
tree5694e12e815d5d0ae44e9b745053ee57881e9c49
parent27b5a84801319e59e488fc830fe0d9fbddf03ae6
serial: txx9: add missing platform_driver_unregister() on error in serial_txx9_init

commit 0c5fc92622ed5531ff324b20f014e9e3092f0187 upstream.

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: ab4382d27412 ("tty: move drivers/serial/ to drivers/tty/serial/")
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
Link: https://lore.kernel.org/r/20201103084942.109076-1-miaoqinglang@huawei.com
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/serial_txx9.c