提交 6098909c 编写于 作者: C Chris Wilson 提交者: Daniel Vetter

drm: Avoid NULL dereference of drm_device.dev

For a virtual device, drm_device.dev is NULL, so becareful not to
dereference it unconditionally in core code such as drm_dev_register().

Fixes: 75f6dfe3 ("drm: Deduplicate driver initialization message")
Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
Cc: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161230141639.10487-1-chris@chris-wilson.co.uk
上级 824387b2
......@@ -762,7 +762,8 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags)
DRM_INFO("Initialized %s %d.%d.%d %s for %s on minor %d\n",
driver->name, driver->major, driver->minor,
driver->patchlevel, driver->date, dev_name(dev->dev),
driver->patchlevel, driver->date,
dev->dev ? dev_name(dev->dev) : "virtual device",
dev->primary->index);
goto out_unlock;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册