Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/nouveau: Skip vga_fini on non-PCI device

As with vga_init, this function doesn't make sense on non-PCI devices,
and the Thunderbolt check in it dereferences a NULL pointer in that
case. Add some code to skip this function when the device is not a PCI
device.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>

authored by

Mikko Perttunen and committed by
Ben Skeggs
876ea7be fcd504e3

+4
+4
drivers/gpu/drm/nouveau/nouveau_vga.c
··· 111 111 struct drm_device *dev = drm->dev; 112 112 bool runtime = nouveau_pmops_runtime(); 113 113 114 + /* only relevant for PCI devices */ 115 + if (!dev->pdev) 116 + return; 117 + 114 118 vga_client_register(dev->pdev, NULL, NULL, NULL); 115 119 116 120 if (pci_is_thunderbolt_attached(dev->pdev))