• Nicolas Ferre's avatar
    atmel_lcdfb: avoid division by zero · 968910bd
    Nicolas Ferre authored
    Avoid division by zero in  atmel_lcdfb_check_var() function.
    
    If pixclock is not specified while passing a var structure in
    the check_var() funtion, a division by zero occurs (when
    translating pixclock to KHz).
    
    This patch adds a checking of this value and try to choose a
    video mode in the modelist.
    
    The mode found in the probe function in added to the modelist.
    
    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
    Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
    Cc: Andrew Victor <linux@maxim.org.za>
    Cc: "Antonino A. Daplas" <adaplas@pol.net>
    Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    968910bd
atmel_lcdfb.c 30.1 KB