summaryrefslogtreecommitdiffstats
path: root/drivers/video/modedb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/modedb.c')
-rw-r--r--drivers/video/modedb.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c
index 1aa36d3..7e539b6 100644
--- a/drivers/video/modedb.c
+++ b/drivers/video/modedb.c
@@ -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;
OpenPOWER on IntegriCloud