diff options
author | Mikko Perttunen <mperttunen@nvidia.com> | 2017-06-09 15:25:41 +0300 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2017-06-16 14:05:04 +1000 |
commit | 876ea7be6a71614ef80c05037350a2ff986e3a80 (patch) | |
tree | 25d6c31b3a40fa63183f3bff5b04e0effefa34d5 /drivers/gpu/drm | |
parent | fcd504e31292c9fdba07bcd44350c145bc214183 (diff) |
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>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_vga.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_vga.c b/drivers/gpu/drm/nouveau/nouveau_vga.c index 02fe0efb9e16..48393a4f6331 100644 --- a/drivers/gpu/drm/nouveau/nouveau_vga.c +++ b/drivers/gpu/drm/nouveau/nouveau_vga.c @@ -111,6 +111,10 @@ nouveau_vga_fini(struct nouveau_drm *drm) struct drm_device *dev = drm->dev; bool runtime = nouveau_pmops_runtime(); + /* only relevant for PCI devices */ + if (!dev->pdev) + return; + vga_client_register(dev->pdev, NULL, NULL, NULL); if (pci_is_thunderbolt_attached(dev->pdev)) |