From: Antonino A. Daplas Date: Tue, 31 Jul 2007 07:37:36 +0000 (-0700) Subject: fbcon: Fix typo and bogus logic in get_default_font X-Git-Tag: v2.6.23-rc2~133 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c81f717cb9e0bd91dc4b98753cb2705ab0fe2801;p=linux-2.6 fbcon: Fix typo and bogus logic in get_default_font Reported in: Bugzilla Bug 8727 Fix typo and bogus logic in get_default_font(). The bug results in get_default_font() returning a font that may not be displayed properly by a framebuffer driver. Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/video/console/fonts.c b/drivers/video/console/fonts.c index a6828d0a4c..96979c3775 100644 --- a/drivers/video/console/fonts.c +++ b/drivers/video/console/fonts.c @@ -133,8 +133,8 @@ const struct font_desc *get_default_font(int xres, int yres, u32 font_w, if ((yres < 400) == (f->height <= 8)) c += 1000; - if (!(font_w & (1 << (f->width - 1))) || - !(font_w & (1 << (f->height - 1)))) + if ((font_w & (1 << (f->width - 1))) && + (font_h & (1 << (f->height - 1)))) c += 1000; if (c > cc) {