Commit 26720dd2 authored by Jonathan Cavitt's avatar Jonathan Cavitt Committed by Tvrtko Ursulin

drm/i915: Allow NULL memory region

Prevent a NULL pointer access in intel_memory_regions_hw_probe.

Fixes: 05da7d9f ("drm/i915/gem: Downgrade stolen lmem setup warning")
Reported-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11704Signed-off-by: default avatarJonathan Cavitt <jonathan.cavitt@intel.com>
Reviewed-by: default avatarNirmoy Das <nirmoy.das@intel.com>
Reviewed-by: default avatarAndi Shyti <andi.shyti@linux.intel.com>
Signed-off-by: default avatarAndi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240712214156.3969584-1-jonathan.cavitt@intel.com
(cherry picked from commit d75dec1f)
Signed-off-by: default avatarTvrtko Ursulin <tursulin@ursulin.net>
parent 65564157
......@@ -368,8 +368,10 @@ int intel_memory_regions_hw_probe(struct drm_i915_private *i915)
goto out_cleanup;
}
mem->id = i;
i915->mm.regions[i] = mem;
if (mem) { /* Skip on non-fatal errors */
mem->id = i;
i915->mm.regions[i] = mem;
}
}
for (i = 0; i < ARRAY_SIZE(i915->mm.regions); i++) {
......
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