From 9cbfe80640488fe9a0b1f55f43a9c2f2c817cb2a Mon Sep 17 00:00:00 2001 From: rsuntk Date: Mon, 9 Jun 2025 22:16:29 +0700 Subject: [PATCH] [skip ci] kernel: minor changes on ksu_sys_umount * Simplify value for 'ret', adding some comments Signed-off-by: rsuntk --- kernel/core_hook.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/kernel/core_hook.c b/kernel/core_hook.c index c88fb6b7..0f5e27ed 100644 --- a/kernel/core_hook.c +++ b/kernel/core_hook.c @@ -983,16 +983,19 @@ static void ksu_path_umount(const char *mnt, struct path *path, int flags) pr_info("%s: path: %s ret: %d\n", __func__, mnt, err); } #else +// TODO: Search a way to make this works without set_fs functions static void ksu_sys_umount(const char *mnt, int flags) { char __user *usermnt = (char __user *)mnt; - - mm_segment_t old_fs = get_fs(); + mm_segment_t old_fs; + int ret; // although asmlinkage long + + old_fs = get_fs(); set_fs(KERNEL_DS); #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) - int ret = ksys_umount(usermnt, flags); + ret = ksys_umount(usermnt, flags); #else - long ret = sys_umount(usermnt, flags); // cuz asmlinkage long sys##name + ret = sys_umount(usermnt, flags); // cuz asmlinkage long sys##name #endif set_fs(old_fs); pr_info("%s: path: %s ret: %d \n", __func__, usermnt, ret);