kernel: address -Wunused-but-set-variable
Signed-off-by: rsuntk <rsuntk@yukiprjkt.my.id>
This commit is contained in:
@@ -666,16 +666,13 @@ static bool should_umount(struct path *path)
|
|||||||
|
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0) || \
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0) || \
|
||||||
defined(KSU_HAS_PATH_UMOUNT)
|
defined(KSU_HAS_PATH_UMOUNT)
|
||||||
static void ksu_path_umount(const char *mnt, struct path *path, int flags)
|
static int ksu_path_umount(struct path *path, int flags)
|
||||||
{
|
{
|
||||||
int ret = path_umount(path, flags);
|
return path_umount(path, flags);
|
||||||
#ifdef CONFIG_KSU_DEBUG
|
|
||||||
pr_info("%s: path: %s ret: %d\n", __func__, mnt, ret);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#define ksu_umount_mnt(mnt, path, flags) (ksu_path_umount(mnt, path, flags))
|
#define ksu_umount_mnt(__unused, path, flags) (ksu_path_umount(path, flags))
|
||||||
#else
|
#else
|
||||||
static void ksu_sys_umount(const char *mnt, int flags)
|
static int ksu_sys_umount(const char *mnt, int flags)
|
||||||
{
|
{
|
||||||
char __user *usermnt = (char __user *)mnt;
|
char __user *usermnt = (char __user *)mnt;
|
||||||
mm_segment_t old_fs;
|
mm_segment_t old_fs;
|
||||||
@@ -689,7 +686,8 @@ static void ksu_sys_umount(const char *mnt, int flags)
|
|||||||
ret = sys_umount(usermnt, flags); // cuz asmlinkage long sys##name
|
ret = sys_umount(usermnt, flags); // cuz asmlinkage long sys##name
|
||||||
#endif
|
#endif
|
||||||
set_fs(old_fs);
|
set_fs(old_fs);
|
||||||
pr_info("%s: path: %s ret: %d\n", __func__, usermnt, ret);
|
pr_info("%s was called, ret: %d\n", __func__, ret);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define ksu_umount_mnt(mnt, __unused, flags) \
|
#define ksu_umount_mnt(mnt, __unused, flags) \
|
||||||
@@ -703,6 +701,7 @@ static void ksu_sys_umount(const char *mnt, int flags)
|
|||||||
static void try_umount(const char *mnt, bool check_mnt, int flags)
|
static void try_umount(const char *mnt, bool check_mnt, int flags)
|
||||||
{
|
{
|
||||||
struct path path;
|
struct path path;
|
||||||
|
int ret;
|
||||||
int err = kern_path(mnt, 0, &path);
|
int err = kern_path(mnt, 0, &path);
|
||||||
if (err) {
|
if (err) {
|
||||||
return;
|
return;
|
||||||
@@ -720,7 +719,12 @@ static void try_umount(const char *mnt, bool check_mnt, int flags)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ksu_umount_mnt(mnt, &path, flags);
|
ret = ksu_umount_mnt(mnt, &path, flags);
|
||||||
|
if (ret) {
|
||||||
|
#ifdef CONFIG_KSU_DEBUG
|
||||||
|
pr_info("%s: path: %s, ret: %d\n", __func__, mnt, ret);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int ksu_handle_setuid(struct cred *new, const struct cred *old)
|
int ksu_handle_setuid(struct cred *new, const struct cred *old)
|
||||||
|
|||||||
Reference in New Issue
Block a user