Skip to content

Commit

Permalink
drm/nouveau/disp: fix oops in destructor with headless cards
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Maarten Lankhorst authored and Ben Skeggs committed Jun 18, 2014
1 parent 82c2b5e commit 242a42e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/gpu/drm/nouveau/core/engine/disp/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 242a42e

Please sign in to comment.