From f51c5b6e623cc737d47f513cbb893cec914f0bd2 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 19 Dec 2008 15:07:11 -0800 Subject: [PATCH] drm: Avoid use-before-null-test on dev in drm_cleanup(). Signed-off-by: Eric Anholt Signed-off-by: Dave Airlie --- drivers/gpu/drm/drm_drv.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 373e3de6434..febb517ee67 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -294,8 +294,6 @@ EXPORT_SYMBOL(drm_init); */ static void drm_cleanup(struct drm_device * dev) { - struct drm_driver *driver = dev->driver; - DRM_DEBUG("\n"); if (!dev) { @@ -330,7 +328,7 @@ static void drm_cleanup(struct drm_device * dev) if (drm_core_check_feature(dev, DRIVER_MODESET)) drm_put_minor(&dev->control); - if (driver->driver_features & DRIVER_GEM) + if (dev->driver->driver_features & DRIVER_GEM) drm_gem_destroy(dev); drm_put_minor(&dev->primary); -- 2.41.1