CVE-2026-72438: md/raid10: fix writes_pending and barrier reference leaks on discard failures
In the Linux kernel, the following vulnerability has been resolved:
md/raid10: fix writespending and barrier reference leaks on discard failures
raid10makerequest() acquires a writespending reference with mdwritestart() before calling raid10handlediscard(). Several failure paths in raid10handlediscard() complete the bio and return without releasing the corresponding reference, causing mdwriteend() to be skipped.
Call mdwriteend() before returning from these failure paths to keep writespending accounting balanced.
Additionally, discard split allocation failures can occur after waitbarrier() succeeds. Those paths return without calling allowbarrier(), leaking the associated barrier reference.
Release the barrier before returning from those paths.