Skip to content

Commit 26720dd

Browse files
Jonathan-Cavitttursulin
authored andcommitted
drm/i915: Allow NULL memory region
Prevent a NULL pointer access in intel_memory_regions_hw_probe. Fixes: 05da7d9 ("drm/i915/gem: Downgrade stolen lmem setup warning") Reported-by: Dan Carpenter <[email protected]> Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11704 Signed-off-by: Jonathan Cavitt <[email protected]> Reviewed-by: Nirmoy Das <[email protected]> Reviewed-by: Andi Shyti <[email protected]> Signed-off-by: Andi Shyti <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit d75dec1) Signed-off-by: Tvrtko Ursulin <[email protected]>
1 parent 6556415 commit 26720dd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/gpu/drm/i915/intel_memory_region.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,10 @@ int intel_memory_regions_hw_probe(struct drm_i915_private *i915)
368368
goto out_cleanup;
369369
}
370370

371-
mem->id = i;
372-
i915->mm.regions[i] = mem;
371+
if (mem) { /* Skip on non-fatal errors */
372+
mem->id = i;
373+
i915->mm.regions[i] = mem;
374+
}
373375
}
374376

375377
for (i = 0; i < ARRAY_SIZE(i915->mm.regions); i++) {

0 commit comments

Comments
 (0)