From 3896fcac80245f3356d30f05c33f6b18090eb184 Mon Sep 17 00:00:00 2001 From: Arnaud Patard Date: Fri, 26 Jan 2007 13:53:48 -0800 Subject: [PATCH] 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 --- drivers/video/omap/omapfb_main.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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) -- 2.41.1