]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drm/nouveau: call drm_vblank_cleanup() earlier
authorBen Skeggs <bskeggs@redhat.com>
Thu, 23 Jan 2014 00:49:47 +0000 (10:49 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 23 Jan 2014 03:39:19 +0000 (13:39 +1000)
Fixes a NULL-ptr deref seen on module unload sometimes.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_display.c

index a22d019bb21719286d56e5c24c0b2e43bed6f8c0..b4262ad66b182de48af73965fb3c0ce4af250e4a 100644 (file)
@@ -74,14 +74,14 @@ nouveau_display_vblank_fini(struct drm_device *dev)
        struct nouveau_display *disp = nouveau_display(dev);
        int i;
 
+       drm_vblank_cleanup(dev);
+
        if (disp->vblank) {
                for (i = 0; i < dev->mode_config.num_crtc; i++)
                        nouveau_event_ref(NULL, &disp->vblank[i]);
                kfree(disp->vblank);
                disp->vblank = NULL;
        }
-
-       drm_vblank_cleanup(dev);
 }
 
 static int