]> git.karo-electronics.de Git - linux-beck.git/commitdiff
OMAP: DSS2: OMAPFB: Check fb2display() return value
authorJani Nikula <ext-jani.1.nikula@nokia.com>
Tue, 1 Jun 2010 12:12:12 +0000 (15:12 +0300)
committerTomi Valkeinen <tomi.valkeinen@nokia.com>
Thu, 5 Aug 2010 13:52:08 +0000 (16:52 +0300)
Make sure NULL return value of fb2display() is not referenced. Found by
Coverity.

Signed-off-by: Jani Nikula <ext-jani.1.nikula@nokia.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
drivers/video/omap2/omapfb/omapfb-ioctl.c
drivers/video/omap2/omapfb/omapfb-main.c

index d1f56d37405fa58e4ebddf40101ff6c55e2e1435..994f6a091b49dbf2af1f080ee426286367481d91 100644 (file)
@@ -858,7 +858,7 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
                        break;
                }
 
-               if (!display->driver->enable_te) {
+               if (!display || !display->driver->enable_te) {
                        r = -ENODEV;
                        break;
                }
index a545e8d4817fedca04afa2986577ef5ec7b5b9c9..db307e3c1dd5bbd7a7e401ed61762af41e660930 100644 (file)
@@ -1271,6 +1271,9 @@ static int omapfb_blank(int blank, struct fb_info *fbi)
        int do_update = 0;
        int r = 0;
 
+       if (!display)
+               return -EINVAL;
+
        omapfb_lock(fbdev);
 
        switch (blank) {