Skip to content

Commit 0050d20

Browse files
committed
kernel: core_hook: fix missed path_put
make sure to path_put() on all codepaths after kern_path() success Signed-off-by: backslashxx <[email protected]>
1 parent 75e3302 commit 0050d20

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kernel/core_hook.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,7 @@ static void try_umount(const char *mnt, int flags)
536536
}
537537

538538
if (path.dentry != path.mnt->mnt_root) {
539+
path_put(&path);
539540
// it is not root mountpoint, maybe umounted by others already.
540541
return;
541542
}
@@ -545,6 +546,7 @@ static void try_umount(const char *mnt, int flags)
545546
#else
546547
ksu_sys_umount(mnt, flags);
547548
#endif
549+
path_put(&path);
548550
}
549551

550552
struct mount_entry {

0 commit comments

Comments
 (0)