From: Lucas Wei Date: Fri, 18 Mar 2022 07:14:01 +0000 (+0800) Subject: fs: sysfs_emit: Remove PAGE_SIZE alignment check X-Git-Tag: v4.19.236~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=10ddfb495232cc9d7bff79f737b4b1b4212fa260;p=thirdparty%2Fkernel%2Fstable.git fs: sysfs_emit: Remove PAGE_SIZE alignment check 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c index 5166eb40917da..011e391497f4e 100644 --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c @@ -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);