diff --git a/src/sys.c b/src/sys.c index 4bf805c..27f5eeb 100644 --- a/src/sys.c +++ b/src/sys.c @@ -1012,7 +1012,7 @@ static long (*real_vfs_statx)(int, struct filename *, int, struct kstat *, u32) static long m_vfs_statx(int dfd, struct filename *filename, int flags, struct kstat *stat, u32 request_mask) { #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0) - char *name = kzalloc(PROCNAME_MAXLEN, GFP_KERNEL); + char name[PROCNAME_MAXLEN] = {0}; #else char *name = filename ? filename->name : ""; #endif @@ -1027,7 +1027,6 @@ static long m_vfs_statx(int dfd, struct filename *filename, int flags, struct ks * */ #if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0) - if (!name) goto leave; if (!copy_from_user((void*)name, filename, sizeof(name)-1)) { #endif if (strlen(name) > 0 && S_ISDIR(stat->mode)) { @@ -1043,8 +1042,6 @@ static long m_vfs_statx(int dfd, struct filename *filename, int flags, struct ks } #if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0) } - if (name) - kfree(name); leave: #endif return rv;