summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_drv.c
diff options
context:
space:
mode:
authorChris Wilson2016-08-19 09:37:50 +0200
committerSean Paul2016-08-22 18:05:06 +0200
commitb4ba97e76763c4e582e3af1079e220e93b1b0d76 (patch)
treeea85d8a800e620235819bd22cce664c7e7b884f3 /drivers/gpu/drm/drm_drv.c
parentdrm: avoid exposing kernel stack in compat_drm_getstats (diff)
downloadkernel-qcow2-linux-b4ba97e76763c4e582e3af1079e220e93b1b0d76.tar.gz
kernel-qcow2-linux-b4ba97e76763c4e582e3af1079e220e93b1b0d76.tar.xz
kernel-qcow2-linux-b4ba97e76763c4e582e3af1079e220e93b1b0d76.zip
drm: Avoid calling dev_printk(.dev = NULL)
Since dev_printk likes to print "(NULL device *):" when passed in a NULL pointer, we have to manually call printk() ourselves. Fixes: c4e68a583202 ("drm: Introduce DRM_DEV_* log messages") Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Eric Engestrom <eric.engestrom@imgtec.com> Cc: Sean Paul <seanpaul@chromium.org> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/20160819073750.16610-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/drm_drv.c')
-rw-r--r--drivers/gpu/drm/drm_drv.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index a7f628298365..acf6a5f38920 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -79,8 +79,11 @@ void drm_dev_printk(const struct device *dev, const char *level,
vaf.fmt = format;
vaf.va = &args;
- dev_printk(level, dev, DRM_PRINTK_FMT, function_name, prefix,
- &vaf);
+ if (dev)
+ dev_printk(level, dev, DRM_PRINTK_FMT, function_name, prefix,
+ &vaf);
+ else
+ printk("%s" DRM_PRINTK_FMT, level, function_name, prefix, &vaf);
va_end(args);
}