aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Winiarski <[email protected]>2017-01-20 20:23:46 +0100
committerChris Wilson <[email protected]>2017-01-20 19:59:53 +0000
commit7e8d12bc733fc9deeb5d78140cda169030fa2ac5 (patch)
treee4b5c7b41444ac77941f74ef55c2adf402ec76c5
parent7e79a6836cfd1bac20e2be3fafdc3caca27c9d69 (diff)
drm/i915/huc: Avoid attempting to authenticate non-existent fw
HuC authentication is called even if HuC firmware is not present in the system, leading to NULL ptr dereference on not allocated gem_object. Let's avoid trying to authenticate HuC if its firmware is not loaded successfully. Fixes: dac84a388528 ("drm/i915/huc: Support HuC authentication") v2: Check inside the auth function, split the assert (Michał) v3: Oops, hit send before compiling, s/huc_fw/huc->fw Cc: Anusha Srivatsa <[email protected]> Cc: Arkadiusz Hiler <[email protected]> Cc: Chris Wilson <[email protected]> Reviewed-by: Michal Wajdeczko <[email protected]> Signed-off-by: Michał Winiarski <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Chris Wilson <[email protected]>
-rw-r--r--drivers/gpu/drm/i915/intel_huc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_huc.c b/drivers/gpu/drm/i915/intel_huc.c
index 897ef31d865e..5edd4f7c3c60 100644
--- a/drivers/gpu/drm/i915/intel_huc.c
+++ b/drivers/gpu/drm/i915/intel_huc.c
@@ -299,6 +299,9 @@ void intel_guc_auth_huc(struct drm_i915_private *dev_priv)
int ret;
u32 data[2];
+ if (huc->fw.load_status != INTEL_UC_FIRMWARE_SUCCESS)
+ return;
+
vma = i915_gem_object_ggtt_pin(huc->fw.obj, NULL, 0, 0,
PIN_OFFSET_BIAS | GUC_WOPCM_TOP);
if (IS_ERR(vma)) {