drm-core, Clean up bug error path on stealth mode exit
parent
0d89b19325
commit
ca1ec9268f
|
@ -437,6 +437,10 @@ void __exit drm_exit(struct drm_driver *driver)
|
||||||
if (drm_fb_loaded) {
|
if (drm_fb_loaded) {
|
||||||
for (i = 0; i < cards_limit; i++) {
|
for (i = 0; i < cards_limit; i++) {
|
||||||
head = drm_heads[i];
|
head = drm_heads[i];
|
||||||
|
if (!head)
|
||||||
|
continue;
|
||||||
|
if (!head->dev)
|
||||||
|
continue;
|
||||||
if (head->dev->driver != driver)
|
if (head->dev->driver != driver)
|
||||||
continue;
|
continue;
|
||||||
dev = head->dev;
|
dev = head->dev;
|
||||||
|
@ -491,12 +495,12 @@ static int __init drm_core_init(void)
|
||||||
DRIVER_NAME,
|
DRIVER_NAME,
|
||||||
DRIVER_MAJOR, DRIVER_MINOR, DRIVER_PATCHLEVEL, DRIVER_DATE);
|
DRIVER_MAJOR, DRIVER_MINOR, DRIVER_PATCHLEVEL, DRIVER_DATE);
|
||||||
return 0;
|
return 0;
|
||||||
err_p3:
|
err_p3:
|
||||||
drm_sysfs_destroy(drm_class);
|
drm_sysfs_destroy(drm_class);
|
||||||
err_p2:
|
err_p2:
|
||||||
unregister_chrdev(DRM_MAJOR, "drm");
|
unregister_chrdev(DRM_MAJOR, "drm");
|
||||||
drm_free(drm_heads, sizeof(*drm_heads) * cards_limit, DRM_MEM_STUB);
|
drm_free(drm_heads, sizeof(*drm_heads) * cards_limit, DRM_MEM_STUB);
|
||||||
err_p1:
|
err_p1:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue