Commit 76aee865 authored by John Harrison's avatar John Harrison

drm/i915/guc: Don't go bang in GuC log if no GuC

If the GuC has failed to load for any reason and then the user pokes
the debugfs GuC log interface, a BUG and/or null pointer deref can
occur. Don't let that happen.
Signed-off-by: default avatarJohn Harrison <John.C.Harrison@Intel.com>
Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211210044022.1842938-5-John.C.Harrison@Intel.com
parent 3d832f37
...@@ -31,7 +31,7 @@ static int guc_log_level_get(void *data, u64 *val) ...@@ -31,7 +31,7 @@ static int guc_log_level_get(void *data, u64 *val)
{ {
struct intel_guc_log *log = data; struct intel_guc_log *log = data;
if (!intel_guc_is_used(log_to_guc(log))) if (!log->vma)
return -ENODEV; return -ENODEV;
*val = intel_guc_log_get_level(log); *val = intel_guc_log_get_level(log);
...@@ -43,7 +43,7 @@ static int guc_log_level_set(void *data, u64 val) ...@@ -43,7 +43,7 @@ static int guc_log_level_set(void *data, u64 val)
{ {
struct intel_guc_log *log = data; struct intel_guc_log *log = data;
if (!intel_guc_is_used(log_to_guc(log))) if (!log->vma)
return -ENODEV; return -ENODEV;
return intel_guc_log_set_level(log, val); return intel_guc_log_set_level(log, val);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment