[LTP] memcg/memcontrol02: fix fd leak in cleanup path

linuxtestproject.agent@gmail.com linuxtestproject.agent@gmail.com
Tue Aug 18 14:45:52 CEST 2026


Hi Disha,

On Aug 18, 2026, Disha Goel wrote:
> memcg/memcontrol02: fix fd leak in cleanup path

--- [PATCH 1/3] ---

> Without this, cleanup would call close(-1) causing TBROK
> when the anon test variant (n=0) runs and never opens fd.

Could this describe the actual failure path instead? Before this patch,
cleanup() does not call close() at all. The descriptor is leaked when an
error after SAFE_OPEN() skips the normal SAFE_CLOSE(fd); the -1 guard is
needed only after adding the cleanup close.

Verdict - Needs revision

---
Note:

The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer


More information about the ltp mailing list