drm/nouveau: fix oops in display destructor with headless cards
Subsystems (3)
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.
Signed-off-by Maarten Lankhorst <[email protected]>
---
drivers/gpu/drm/nouveau/core/engine/disp/base.c +4 -2
@@ -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]
Quoted 1 line · Maarten Lankhorst
If init doesn't run then
disp->outpmight 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
Signed-off-by Maarten Lankhorst <[email protected]>---
drivers/gpu/drm/nouveau/core/engine/disp/base.c +4
-2@@ -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