From ca1ec9268f9de783daf3f2db86a4fb47108d609a Mon Sep 17 00:00:00 2001 From: Jon Smirl Date: Tue, 19 Oct 2004 02:50:14 +0000 Subject: drm-core, Clean up bug error path on stealth mode exit --- linux-core/drm_drv.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'linux-core') diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c index 59a194d9..b59b5ca5 100644 --- a/linux-core/drm_drv.c +++ b/linux-core/drm_drv.c @@ -437,6 +437,10 @@ void __exit drm_exit(struct drm_driver *driver) if (drm_fb_loaded) { for (i = 0; i < cards_limit; i++) { head = drm_heads[i]; + if (!head) + continue; + if (!head->dev) + continue; if (head->dev->driver != driver) continue; dev = head->dev; @@ -491,12 +495,12 @@ static int __init drm_core_init(void) DRIVER_NAME, DRIVER_MAJOR, DRIVER_MINOR, DRIVER_PATCHLEVEL, DRIVER_DATE); return 0; - err_p3: +err_p3: drm_sysfs_destroy(drm_class); - err_p2: +err_p2: unregister_chrdev(DRM_MAJOR, "drm"); drm_free(drm_heads, sizeof(*drm_heads) * cards_limit, DRM_MEM_STUB); - err_p1: +err_p1: return ret; } -- cgit v1.2.3