little patches for fbmem.c and offb.c
The fbmem.c bug made "less /proc/fb" segfault, as it made read() returned more
bytes than were requested.
The offb.c bug caused /proc/fb output to be incorrect, and potentially could cause kernel data structure corruption.
Enjoy,
Segher
--->SNIP HERE<---
drivers/video/fbmem.c +5 -3
@@ -251,14 +251,16 @@ {struct fb_info **fi; - len =0 ; +int buflen =0 ;for (fi = registered_fb; fi < ®istered_fb[FB_MAX ] && len <4000 ; fi++)if (*fi) - len +=sprintf (buf + len,"%d %s\n" , + buflen +=sprintf (buf + buflen,"%d %s\n" ,GET_FB_IDX ((*fi)->node), (*fi)->modename); *start = buf + offset; -return len > offset ? len - offset :0 ; + + buflen = buflen > offset ? buflen - offset :0 ; +return len < buflen ? len : buflen; } static ssize_t
drivers/video/offb.c +1 -2
@@ -733,7 +733,7 @@ disp->scrollmode =SCROLL_YREDRAW ;strcpy (info->info.modename,"OFfb " ); -strncat (info->info.modename, full_name,sizeof (info->info.modename)); +strncat (info->info.modename, full_name,sizeof (info->info.modename) - 6); info->info.node = -1; info->info.fbops = &offb_ops;
info->info.disp = disp;
--->SNIP HERE<---