Skip to contentSkip to conversation

drm/nouveau: fix oops in display destructor with headless cards

PATCH In review Maarten Lankhorst 2 participants 2 messages Jun 17, 2014 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/nouveau: fix oops in display destructor with headless cards

If init doesn't run then disp->outp might not be initialized, resulting in an oops.

---

drivers/gpu/drm/nouveau/core/engine/disp/base.c +4 -2
index c41f656abe64..9c38c5e40500 100644
@@ -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);

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 1 line · Maarten Lankhorst

If init doesn't run then disp->outp might not be initialized, resulting in an oops.

This can't actually happen (in the very least, it's not supposed to)... What makes you think it can?

Quoted 25 lines

---

drivers/gpu/drm/nouveau/core/engine/disp/base.c +4 -2
index c41f656abe64..9c38c5e40500 100644
@@ -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);

_______________________________________________
dri-devel mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel