aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video')
-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 1aa36d302a51..7e539b69a9a2 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,
791 if (diff > d) { 791 if (diff > d) {
792 diff = d; 792 diff = d;
793 best = mode; 793 best = mode;
794 } else if (diff == d && mode->refresh > best->refresh) 794 } else if (diff == d && best &&
795 best = mode; 795 mode->refresh > best->refresh)
796 best = mode;
796 } 797 }
797 } 798 }
798 return best; 799 return best;