From: Arnaud Patard Date: Fri, 26 Jan 2007 21:53:48 +0000 (-0800) Subject: omapfb: Add sanity check to omapfb_update_window_async X-Git-Tag: v2.6.21-omap1~138 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=3896fcac80245f3356d30f05c33f6b18090eb184;p=linux-2.6-omap-h63xx.git 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 Signed-off-by: Tony Lindgren --- diff --git a/drivers/video/omap/omapfb_main.c b/drivers/video/omap/omapfb_main.c index b2dce7b9507..a7cf760d44d 100644 --- a/drivers/video/omap/omapfb_main.c +++ b/drivers/video/omap/omapfb_main.c @@ -626,10 +626,15 @@ int omapfb_update_window_async(struct fb_info *fbi, void (*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)