diff options
author | Shang XiaoJing <shangxiaojing@huawei.com> | 2022-11-14 09:08:52 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-01-07 12:07:27 +0100 |
commit | 5bf10c3be038a0b5b79fd8d69920b72bdcb59d2d (patch) | |
tree | 6a5df11487007af655ad98d06f97ac55a04ba141 | |
parent | 0a71d0472cf2c420ca5ef99b71a292aa648301e2 (diff) | |
download | linux-stable-5bf10c3be038a0b5b79fd8d69920b72bdcb59d2d.tar.gz linux-stable-5bf10c3be038a0b5b79fd8d69920b72bdcb59d2d.tar.bz2 linux-stable-5bf10c3be038a0b5b79fd8d69920b72bdcb59d2d.zip |
fbdev: via: Fix error in via_core_init()
[ Upstream commit 5886b130de953cfb8826f7771ec8640a79934a7f ]
via_core_init() won't exit the driver when pci_register_driver() failed.
Exit the viafb-i2c and the viafb-gpio in failed path to prevent error.
VIA Graphics Integration Chipset framebuffer 2.4 initializing
Error: Driver 'viafb-i2c' is already registered, aborting...
Error: Driver 'viafb-gpio' is already registered, aborting...
Fixes: 7582eb9be85f ("viafb: Turn GPIO and i2c into proper platform devices")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/video/fbdev/via/via-core.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/video/fbdev/via/via-core.c b/drivers/video/fbdev/via/via-core.c index 1d28e16888e9..84f7835956a9 100644 --- a/drivers/video/fbdev/via/via-core.c +++ b/drivers/video/fbdev/via/via-core.c @@ -775,7 +775,14 @@ static int __init via_core_init(void) return ret; viafb_i2c_init(); viafb_gpio_init(); - return pci_register_driver(&via_driver); + ret = pci_register_driver(&via_driver); + if (ret) { + viafb_gpio_exit(); + viafb_i2c_exit(); + return ret; + } + + return 0; } static void __exit via_core_exit(void) |