Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/i915/overlay: Fix oops on unload

Apparently I failed to test the unload case properly and
thus didn't notice that the i915_overlay_is_active() needs
i915->overlay after fetch_and_zero() already cleared it.
Stop using fetch_and_zero() and only clear the pointer at
the end to avoid the oops.

Fixes: 38d9a352c45e ("drm/i915/overlay: Extract i915_overlay_is_active()")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20260303101417.14409-1-ville.syrjala@linux.intel.com
Reviewed-by: Michał Grzelak <michal.grzelak@intel.com>

+2 -2
+2 -2
drivers/gpu/drm/i915/i915_overlay.c
··· 482 482 static void i915_overlay_cleanup(struct drm_device *drm) 483 483 { 484 484 struct drm_i915_private *i915 = to_i915(drm); 485 - struct i915_overlay *overlay; 485 + struct i915_overlay *overlay = i915->overlay; 486 486 487 - overlay = fetch_and_zero(&i915->overlay); 488 487 if (!overlay) 489 488 return; 490 489 ··· 498 499 i915_active_fini(&overlay->last_flip); 499 500 500 501 kfree(overlay); 502 + i915->overlay = NULL; 501 503 } 502 504 503 505 const struct intel_display_overlay_interface i915_display_overlay_interface = {