Sfoglia il codice sorgente

drm/nouveau: fix null pointer dereference in poll_changed

Fixes vgaswitcheroo on a card without display.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Maarten Lankhorst 12 anni fa
parent
commit
8a258353ed
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. 2 1
      drivers/gpu/drm/nouveau/nouveau_fbcon.c

+ 2 - 1
drivers/gpu/drm/nouveau/nouveau_fbcon.c

@@ -398,7 +398,8 @@ void
 nouveau_fbcon_output_poll_changed(struct drm_device *dev)
 nouveau_fbcon_output_poll_changed(struct drm_device *dev)
 {
 {
 	struct nouveau_drm *drm = nouveau_drm(dev);
 	struct nouveau_drm *drm = nouveau_drm(dev);
-	drm_fb_helper_hotplug_event(&drm->fbcon->helper);
+	if (drm->fbcon)
+		drm_fb_helper_hotplug_event(&drm->fbcon->helper);
 }
 }
 
 
 static int
 static int