Commit a09fd48f authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

[PATCH] fbdev: correct buffer size limit in fbmem_read_proc()

Address http://bugzilla.kernel.org/show_bug.cgi?id=7189

It should check `clen', not `len'.
Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Cc: <jurij@wooyd.org>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: <stable@kernel.org>
Cc: Willy Tarreau <w@1wt.eu>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f5b747b4
...@@ -554,7 +554,8 @@ static int fbmem_read_proc(char *buf, char **start, off_t offset, ...@@ -554,7 +554,8 @@ static int fbmem_read_proc(char *buf, char **start, off_t offset,
int clen; int clen;
clen = 0; clen = 0;
for (fi = registered_fb; fi < &registered_fb[FB_MAX] && len < 4000; fi++) for (fi = registered_fb; fi < &registered_fb[FB_MAX] && clen < 4000;
fi++)
if (*fi) if (*fi)
clen += sprintf(buf + clen, "%d %s\n", clen += sprintf(buf + clen, "%d %s\n",
(*fi)->node, (*fi)->node,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment