diff options
author | John Harrison <John.C.Harrison@Intel.com> | 2021-12-10 05:40:22 +0100 |
---|---|---|
committer | John Harrison <John.C.Harrison@Intel.com> | 2021-12-11 02:00:25 +0100 |
commit | 76aee8658b8f5836ace0a423157f29fcaec65e30 (patch) | |
tree | b473134d538a4e23b32e4d9d88e162b94e3c9cd1 /drivers/gpu/drm/i915/gt | |
parent | drm/i915/uc: Allow platforms to have GuC but not HuC (diff) | |
download | linux-76aee8658b8f5836ace0a423157f29fcaec65e30.tar.xz linux-76aee8658b8f5836ace0a423157f29fcaec65e30.zip |
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: John Harrison <John.C.Harrison@Intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211210044022.1842938-5-John.C.Harrison@Intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/gt')
-rw-r--r-- | drivers/gpu/drm/i915/gt/uc/intel_guc_log_debugfs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_log_debugfs.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_log_debugfs.c index 46026c2c1722..8fd068049376 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log_debugfs.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log_debugfs.c @@ -31,7 +31,7 @@ static int guc_log_level_get(void *data, u64 *val) { struct intel_guc_log *log = data; - if (!intel_guc_is_used(log_to_guc(log))) + if (!log->vma) return -ENODEV; *val = intel_guc_log_get_level(log); @@ -43,7 +43,7 @@ static int guc_log_level_set(void *data, u64 val) { struct intel_guc_log *log = data; - if (!intel_guc_is_used(log_to_guc(log))) + if (!log->vma) return -ENODEV; return intel_guc_log_set_level(log, val); |