···1213#include <linux/module.h>14#include <linux/kobject.h>015#include <linux/namei.h>16#include <linux/poll.h>17#include <linux/list.h>···87 * The code works fine with PAGE_SIZE return but it's likely to88 * indicate truncated result or overflow in normal use cases.89 */90- BUG_ON(count >= (ssize_t)PAGE_SIZE);0000091 if (count >= 0) {92 buffer->needs_read_fill = 0;93 buffer->count = count;
···1213#include <linux/module.h>14#include <linux/kobject.h>15+#include <linux/kallsyms.h>16#include <linux/namei.h>17#include <linux/poll.h>18#include <linux/list.h>···86 * The code works fine with PAGE_SIZE return but it's likely to87 * indicate truncated result or overflow in normal use cases.88 */89+ if (count >= (ssize_t)PAGE_SIZE) {90+ print_symbol("fill_read_buffer: %s returned bad count\n",91+ (unsigned long)ops->show);92+ /* Try to struggle along */93+ count = PAGE_SIZE - 1;94+ }95 if (count >= 0) {96 buffer->needs_read_fill = 0;97 buffer->count = count;