]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
omapfb: Add sanity check to omapfb_update_window_async
authorArnaud Patard <arnaud.patard@rtp-net.org>
Fri, 26 Jan 2007 21:53:48 +0000 (13:53 -0800)
committerTony Lindgren <tony@atomide.com>
Fri, 26 Jan 2007 21:53:48 +0000 (13:53 -0800)
This patch makes sure that the fb_info pointer given to
omapfb_update_window_async is not null.

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/video/omap/omapfb_main.c

index b2dce7b9507bf55552638bb0d5e725c98eca7d32..a7cf760d44dbd1a323c0797b42bbbb8471238827 100644 (file)
@@ -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)