omapfb: Add sanity check to omapfb_update_window_async
PATCH 1/1 omapfb: Add sanity check to omapfb_update_window_async
This patch makes sure that the fb_info pointer given to omapfb_update_window_async is not null.
Signed-off-by Arnaud Patard <[email protected]>
---
---
drivers/video/omap/omapfb_main.c | 9 7 + 2 - 0 !
1 file changed, 7 insertions(+), 2 deletions(-)
drivers/video/omap/omapfb_main.c +7 -2
@@ -626,10 +626,15 @@ int omapfb_update_window_async(struct fbvoid (*callback)(void *), void *callback_data) { - struct omapfb_plane_struct *plane = fbi->par; -struct omapfb_device *fbdev = plane->fbdev; + struct omapfb_plane_struct *plane; +struct omapfb_device *fbdev;struct fb_var_screeninfo *var; +if (!fbi) +return -EINVAL ; + + plane = fbi->par; + fbdev = plane->fbdev; var = &fbi->var;if (win->x >= var->xres || win->y >= var->yres)
Quoted 23 lines · Arnaud Patard
This patch makes sure that the
fb_infopointer given toomapfb_update_window_asyncis not null.Signed-off-by Arnaud Patard <[email protected]>---
---
drivers/video/omap/omapfb_main.c| 9 7 + 2 - 0 !1 file changed, 7 insertions(+), 2 deletions(-)Index:
linux-omap-2.6/drivers/video/omap/omapfb_main.c
===================================================================drivers/video/omap/omapfb_main.c +2
-2@@ -626,10 +626,15 @@ int omapfb_update_window_async(struct fbvoid (*callback)(void *), void *callback_data) { - struct omapfb_plane_struct *plane = fbi->par; -struct omapfb_device *fbdev = plane->fbdev; + struct omapfb_plane_struct *plane; +struct omapfb_device *fbdev;
drivers/video/omap/omapfb_main.c int omapfb_update_window_async(struct fb · line 640
Quoted 10 lines
drivers/video/omap/omapfb_main.c +5
-0struct fb_var_screeninfo *var; +if (!fbi) +return -EINVAL ; + + plane = fbi->par; + fbdev = plane->fbdev; var = &fbi->var;if (win->x >= var->xres || win->y >= var->yres)
Pushing today.
Tony