summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@canonical.com>2014-06-17 15:01:48 +0200
committerBen Skeggs <bskeggs@redhat.com>2014-06-18 15:49:50 +1000
commit242a42eadfc17448a0d5b2ffc0cb191c8b51971a (patch)
tree2aa266e90e59f86b04d5dd2cb7e1441b2dd18380 /drivers/gpu
parent82c2b5ed6f2760caaa7871f018166fadd849d2d2 (diff)
downloadop-kernel-dev-242a42eadfc17448a0d5b2ffc0cb191c8b51971a.zip
op-kernel-dev-242a42eadfc17448a0d5b2ffc0cb191c8b51971a.tar.gz
drm/nouveau/disp: fix oops in destructor with headless cards
If init doesn't run then disp->outp might not be initialized, resulting in an oops. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/disp/base.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/base.c b/drivers/gpu/drm/nouveau/core/engine/disp/base.c
index c41f656..9c38c5e 100644
--- a/drivers/gpu/drm/nouveau/core/engine/disp/base.c
+++ b/drivers/gpu/drm/nouveau/core/engine/disp/base.c
@@ -99,8 +99,10 @@ _nouveau_disp_dtor(struct nouveau_object *object)
nouveau_event_destroy(&disp->vblank);
- list_for_each_entry_safe(outp, outt, &disp->outp, head) {
- nouveau_object_ref(NULL, (struct nouveau_object **)&outp);
+ if (disp->outp.next) {
+ list_for_each_entry_safe(outp, outt, &disp->outp, head) {
+ nouveau_object_ref(NULL, (struct nouveau_object **)&outp);
+ }
}
nouveau_engine_destroy(&disp->base);
OpenPOWER on IntegriCloud