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: Don't use fetch_and_zero() in display code

We don't generally want fetch_and_zero() on the display side, so
stop using it in the display side intel_overlay_cleanup().
Fortunately we don't really have anything to do here apart from
freeing the data. And we'll keep on clearing the pointer, just
in case something somewhere cares about it.

Note that once i915_overlay_cleanup() is converted to the parent
interface we can't call it unconditionally (as xe won't have it).
So we need to keep the early bailout for overlay==NULL.

v2: Adjust the commit message since we do apparently
have fetch_and_zero() in display code as well (Jani)
v3: Skip i915_overlay_cleanup() if the overlay wasn't initialized

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20260226130113.16714-1-ville.syrjala@linux.intel.com

+3 -5
+3 -5
drivers/gpu/drm/i915/display/intel_overlay.c
··· 1554 1554 1555 1555 void intel_overlay_cleanup(struct intel_display *display) 1556 1556 { 1557 - struct intel_overlay *overlay; 1558 - 1559 - overlay = fetch_and_zero(&display->overlay); 1560 - if (!overlay) 1557 + if (!display->overlay) 1561 1558 return; 1562 1559 1563 1560 i915_overlay_cleanup(display->drm); 1564 1561 1565 - kfree(overlay); 1562 + kfree(display->overlay); 1563 + display->overlay = NULL; 1566 1564 }