]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/i915/gt: Prevent error pointer dereference
authorDan Carpenter <dan.carpenter@linaro.org>
Wed, 13 Sep 2023 08:17:41 +0000 (11:17 +0300)
committerAndi Shyti <andi.shyti@kernel.org>
Thu, 14 Sep 2023 08:17:13 +0000 (10:17 +0200)
commitc92ec50822fb84306d951520d81919328421acbd
treea1fe141da3a08467c789119908d9874d3221435c
parent3b2562dcf91d460753871415f9571effc7965fcf
drm/i915/gt: Prevent error pointer dereference

Move the check for "if (IS_ERR(obj))" in front of the call to
i915_gem_object_set_cache_coherency() which dereferences "obj".
Otherwise it will lead to a crash.

Fixes: 43aa755eae2c ("drm/i915/mtl: Update cache coherency setting for context structure")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/455b2279-2e08-4d00-9784-be56d8ee42e3@moroto.mountain
drivers/gpu/drm/i915/gt/intel_lrc.c