mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
drm/hyperv: Unregister pci driver in error path before module unload
The pci driver must not kept registered if the module is unloaded after
vmbus_driver_register() fails. So check the return value of
vmbus_driver_register() and unregister the pci driver on failure.
Fixes: 76c56a5aff ("drm/hyperv: Add DRM driver for hyperv synthetic video device")
Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Michael Kelley <mhklinux@outlook.com>
Signed-off-by: Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>
Link: https://patch.msgid.link/4b7dbf00ce4ff664b7d5dd74b2f39d8d87c1ade9.1782925276.git.u.kleine-koenig@baylibre.com
This commit is contained in:
parent
b67ac31d7f
commit
8c11cfc8c1
|
|
@ -249,7 +249,11 @@ static int __init hv_drm_init(void)
|
|||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
return vmbus_driver_register(&hv_drm_hv_driver);
|
||||
ret = vmbus_driver_register(&hv_drm_hv_driver);
|
||||
if (ret)
|
||||
pci_unregister_driver(&hv_drm_pci_driver);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void __exit hv_drm_exit(void)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user