Skip to content

Commit

Permalink
drm: Avoid use-before-null-test on dev in drm_cleanup().
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@linux.ie>
  • Loading branch information
Eric Anholt authored and Dave Airlie committed Dec 29, 2008
1 parent f1acec9 commit f51c5b6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/gpu/drm/drm_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit f51c5b6

Please sign in to comment.