[PATCH] fbdev: Coverity Bug 90
authorAntonino A. Daplas <adaplas@gmail.com>
Mon, 26 Jun 2006 07:26:44 +0000 (00:26 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 26 Jun 2006 16:58:31 +0000 (09:58 -0700)
It's a false positive, but let's suppress it anyway.

Signed-off-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/video/modedb.c

index 1aa36d302a51b994e90c5428f81facc5b28cafff..7e539b69a9a20a1c13f148a9cca5ebd01ef13032 100644 (file)
@@ -791,8 +791,9 @@ struct fb_videomode *fb_find_best_mode(struct fb_var_screeninfo *var,
                        if (diff > d) {
                                diff = d;
                                best = mode;
-                       } else if (diff == d && mode->refresh > best->refresh)
-                           best = mode;
+                       } else if (diff == d && best &&
+                                  mode->refresh > best->refresh)
+                               best = mode;
                }
        }
        return best;