kernel: core_hook: fix refcount leaks on try_umount (#2635)

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
Signed-off-by: rsuntk <rsuntk@yukiprjkt.my.id>
Co-authored-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
This commit is contained in:
rsuntk
2025-06-13 12:26:49 +07:00
committed by ShirkNeko
parent c83baad6d5
commit 483a39c7ac

View File

@@ -566,11 +566,13 @@ static void try_umount(const char *mnt, bool check_mnt, int flags)
if (path.dentry != path.mnt->mnt_root) { if (path.dentry != path.mnt->mnt_root) {
// it is not root mountpoint, maybe umounted by others already. // it is not root mountpoint, maybe umounted by others already.
path_put(&path);
return; return;
} }
// we are only interest in some specific mounts // we are only interest in some specific mounts
if (check_mnt && !should_umount(&path)) { if (check_mnt && !should_umount(&path)) {
path_put(&path);
return; return;
} }