i915: fix oops when reading i915_context_status on debugfs From: Pavel Roskin Signed-off-by: Pavel Roskin If passed NULL, describe_obj() prints "(null)" now. --- drivers/gpu/drm/i915/i915_debugfs.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 4d46441..51f13b0 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -119,6 +119,11 @@ static const char *cache_level_str(int type) static void describe_obj(struct seq_file *m, struct drm_i915_gem_object *obj) { + if (!obj) { + seq_printf(m, "(null)"); + return; + } + seq_printf(m, "%p: %s%s %8zd %04x %04x %d %d%s%s%s", &obj->base, get_pin_flag(obj),