kernel: Fix compilation for non-gki kernels

Co-authored-by: TwinbornPlate75 <3342733415@qq.com>
This commit is contained in:
ShirkNeko
2025-11-09 13:35:42 +08:00
parent a525048d1f
commit 3e5f69cdf8
4 changed files with 31 additions and 11 deletions

View File

@@ -383,10 +383,16 @@ static int do_get_wrapper_fd(void __user *arg) {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)
#define getfd_secure anon_inode_create_getfd
#else
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
#define getfd_secure anon_inode_getfd_secure
#else
#define getfd_secure anon_inode_getfd
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
ret = getfd_secure("[ksu_fdwrapper]", &data->ops, data, f->f_flags, NULL);
#else
ret = getfd_secure("[ksu_fdwrapper]", &data->ops, data, f->f_flags);
#endif
if (ret < 0) {
pr_err("ksu_fdwrapper: getfd failed: %d\n", ret);
goto put_wrapper_data;