kernel: core_hook: fix missed path_put

make sure to path_put() on all codepaths after kern_path() success

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
Signed-off-by: rsuntk <90097027+rsuntk@users.noreply.github.com>
This commit is contained in:
backslashxx
2025-06-10 14:13:07 +00:00
committed by ShirkNeko
parent e4285fcb25
commit 29de74c941

View File

@@ -591,6 +591,7 @@ 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;
} }
@@ -604,6 +605,7 @@ static void try_umount(const char *mnt, bool check_mnt, int flags)
#else #else
ksu_sys_umount(mnt, flags); ksu_sys_umount(mnt, flags);
#endif #endif
path_put(&path);
} }
int ksu_handle_setuid(struct cred *new, const struct cred *old) int ksu_handle_setuid(struct cred *new, const struct cred *old)