Re: [tip:x86/urgent] x86/simplefb: Fix overflow causing bogus fall-back

2013-10-03 Thread Ingo Molnar

* Geert Uytterhoeven  wrote:

> On Thu, Oct 3, 2013 at 3:59 PM, tip-bot for Tom Gundersen
>  wrote:
> > On my MacBook Air lfb_size is 4M, which makes the bitshit
> 
> bitshift?

LOL!

Thanks,

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [tip:x86/urgent] x86/simplefb: Fix overflow causing bogus fall-back

2013-10-03 Thread Geert Uytterhoeven
On Thu, Oct 3, 2013 at 3:59 PM, tip-bot for Tom Gundersen
 wrote:
> On my MacBook Air lfb_size is 4M, which makes the bitshit

bitshift?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[tip:x86/urgent] x86/simplefb: Fix overflow causing bogus fall-back

2013-10-03 Thread tip-bot for Tom Gundersen
Commit-ID:  e33a29a5ae711162c6b6fefc0a2ef18f4a4254bf
Gitweb: http://git.kernel.org/tip/e33a29a5ae711162c6b6fefc0a2ef18f4a4254bf
Author: Tom Gundersen 
AuthorDate: Tue, 1 Oct 2013 18:18:40 +0200
Committer:  Ingo Molnar 
CommitDate: Wed, 2 Oct 2013 07:50:40 +0200

x86/simplefb: Fix overflow causing bogus fall-back

On my MacBook Air lfb_size is 4M, which makes the bitshit
overflow (to 256GB - larger than 32 bits), meaning we fall
back to efifb unnecessarily.

Cast to u64 to avoid the overflow.

Signed-off-by: Tom Gundersen 
Reviewed-by: David Herrmann 
Cc: Geert Uytterhoeven 
Cc: Stephen Warren 
Cc: Stephen Warren 
Link: http://lkml.kernel.org/r/1380644320-1026-1-git-send-email-...@jklm.no
Signed-off-by: Ingo Molnar 
---
 arch/x86/kernel/sysfb_simplefb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/sysfb_simplefb.c b/arch/x86/kernel/sysfb_simplefb.c
index 22513e9..4ebd636 100644
--- a/arch/x86/kernel/sysfb_simplefb.c
+++ b/arch/x86/kernel/sysfb_simplefb.c
@@ -72,7 +72,7 @@ __init int create_simplefb(const struct screen_info *si,
 * the part that is occupied by the framebuffer */
len = mode->height * mode->stride;
len = PAGE_ALIGN(len);
-   if (len > si->lfb_size << 16) {
+   if (len > (u64)si->lfb_size << 16) {
printk(KERN_WARNING "sysfb: VRAM smaller than advertised\n");
return -EINVAL;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/