]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
fs: sysfs_emit: Remove PAGE_SIZE alignment check
authorLucas Wei <lucaswei@google.com>
Fri, 18 Mar 2022 07:14:01 +0000 (15:14 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Mar 2022 08:10:42 +0000 (09:10 +0100)
For kernel releases older than 4.20, using the SLUB alloctor will cause
this alignment check to fail as that allocator did NOT align kmalloc
allocations on a PAGE_SIZE boundry.

Remove the check for these older kernels as it is a false-positive and
causes problems on many devices.

Signed-off-by: Lucas Wei <lucaswei@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/sysfs/file.c

index 5166eb40917dac2e1bcc54f11c5d14ea927b3bde..011e391497f4eb14cf9fe96ca8518ff5dd07476d 100644 (file)
@@ -572,8 +572,7 @@ int sysfs_emit(char *buf, const char *fmt, ...)
        va_list args;
        int len;
 
-       if (WARN(!buf || offset_in_page(buf),
-                "invalid sysfs_emit: buf:%p\n", buf))
+       if (WARN(!buf, "invalid sysfs_emit: buf:%p\n", buf))
                return 0;
 
        va_start(args, fmt);