Commit f51c5b6e authored by Eric Anholt's avatar Eric Anholt Committed by Dave Airlie

drm: Avoid use-before-null-test on dev in drm_cleanup().

Signed-off-by: default avatarEric Anholt <eric@anholt.net>
Signed-off-by: default avatarDave Airlie <airlied@linux.ie>
parent f1acec93
...@@ -294,8 +294,6 @@ EXPORT_SYMBOL(drm_init); ...@@ -294,8 +294,6 @@ EXPORT_SYMBOL(drm_init);
*/ */
static void drm_cleanup(struct drm_device * dev) static void drm_cleanup(struct drm_device * dev)
{ {
struct drm_driver *driver = dev->driver;
DRM_DEBUG("\n"); DRM_DEBUG("\n");
if (!dev) { if (!dev) {
...@@ -330,7 +328,7 @@ static void drm_cleanup(struct drm_device * dev) ...@@ -330,7 +328,7 @@ static void drm_cleanup(struct drm_device * dev)
if (drm_core_check_feature(dev, DRIVER_MODESET)) if (drm_core_check_feature(dev, DRIVER_MODESET))
drm_put_minor(&dev->control); drm_put_minor(&dev->control);
if (driver->driver_features & DRIVER_GEM) if (dev->driver->driver_features & DRIVER_GEM)
drm_gem_destroy(dev); drm_gem_destroy(dev);
drm_put_minor(&dev->primary); drm_put_minor(&dev->primary);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment