drm: Avoid NULL dereference of drm_device.dev
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 30 Dec 2016 14:16:39 +0000 (14:16 +0000)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 30 Dec 2016 14:29:44 +0000 (15:29 +0100)
commit6098909cf2d0f9dda63aed3b6651d91f7ce6a473
treee947e57af64f37a4891bd9591b33acf65120a62a
parent824387b2f6a1a177bf518a61ebbf861ae058f45d
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: 75f6dfe3e652 ("drm: Deduplicate driver initialization message")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161230141639.10487-1-chris@chris-wilson.co.uk
drivers/gpu/drm/drm_drv.c