From: Daniel Vetter Date: Wed, 21 Jun 2017 13:04:29 +0000 (+0200) Subject: drm: Check for drm_device->dev in drm_set_busid X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=22a884cfe5a49b6fd63f10ff137906028b4cf923;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm: Check for drm_device->dev in drm_set_busid I've failed to remember that we have virtual drivers like vgem which have no underlying struct device. Fix this asap. Reported-by: Chris Wilson Cc: Chris Wilson Reviewed-by: Chris Wilson Fixes: 5c484cee7ef9 ("drm: Remove drm_driver->set_busid hook") Cc: Thierry Reding Cc: Daniel Vetter Signed-off-by: Daniel Vetter Link: http://patchwork.freedesktop.org/patch/msgid/20170621130429.20537-1-daniel.vetter@ffwll.ch --- diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c index 3a36b3717c28..d74473570acd 100644 --- a/drivers/gpu/drm/drm_ioctl.c +++ b/drivers/gpu/drm/drm_ioctl.c @@ -143,7 +143,7 @@ static int drm_set_busid(struct drm_device *dev, struct drm_file *file_priv) if (master->unique != NULL) drm_unset_busid(dev, master); - if (dev_is_pci(dev->dev)) { + if (dev->dev && dev_is_pci(dev->dev)) { ret = drm_pci_set_busid(dev, master); if (ret) { drm_unset_busid(dev, master);