diff options
author | Marcin Slusarz <marcin.slusarz@gmail.com> | 2010-01-30 14:41:00 (GMT) |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-02-10 23:52:00 (GMT) |
commit | dd19e44b28b12f7ea59ebb54d8ea18054da7f9d1 (patch) | |
tree | b41add6f15ebf6b7666f45b1b3d7002b3f29036b /drivers/gpu/drm/nouveau/nv50_crtc.c | |
parent | b1d37aa0aa43c5bf857364093ab2191acd37f2ec (diff) | |
download | linux-dd19e44b28b12f7ea59ebb54d8ea18054da7f9d1.tar.xz |
drm/nouveau: move dereferences after null checks
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nv50_crtc.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nv50_crtc.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_crtc.c b/drivers/gpu/drm/nouveau/nv50_crtc.c index 40b7360..d1a651e 100644 --- a/drivers/gpu/drm/nouveau/nv50_crtc.c +++ b/drivers/gpu/drm/nouveau/nv50_crtc.c @@ -298,14 +298,17 @@ nv50_crtc_set_clock(struct drm_device *dev, int head, int pclk) static void nv50_crtc_destroy(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; - struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); - - NV_DEBUG_KMS(dev, "\n"); + struct drm_device *dev; + struct nouveau_crtc *nv_crtc; if (!crtc) return; + dev = crtc->dev; + nv_crtc = nouveau_crtc(crtc); + + NV_DEBUG_KMS(dev, "\n"); + drm_crtc_cleanup(&nv_crtc->base); nv50_cursor_fini(nv_crtc); |