diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c index a8176c875f55e..53428aab5dd88 100644 --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c @@ -70,9 +70,8 @@ static int sysfs_kf_seq_show(struct seq_file *sf, void *v) * The code works fine with PAGE_SIZE return but it's likely to * indicate truncated result or overflow in normal use cases. */ - if (count >= (ssize_t)PAGE_SIZE) { - printk("fill_read_buffer: %pS returned bad count\n", - ops->show); + if (count >= PAGE_SIZE) { + WARN(1, "OOB write or bad count %zd at %pS\n", count, ops->show); /* Try to struggle along */ count = PAGE_SIZE - 1; }