]> err.no Git - linux-2.6/commitdiff
[PATCH] powerpc: Loosen udbg_probe_uart_speed sanity checking
authorKumar Gala <galak@gate.crashing.org>
Tue, 20 Dec 2005 22:16:26 +0000 (16:16 -0600)
committerPaul Mackerras <paulus@samba.org>
Mon, 9 Jan 2006 04:33:42 +0000 (15:33 +1100)
The checking of the baudrate in udbg_probe_uart_speed was
too tight and would cause reporting back of the default
baud rate in cases where the computed speed was valid.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kernel/udbg_16550.c

index e58c048a7b195919db6426166220f37e598b32cb..7541bf44d2da5e95ce7a7cc9a789e7e7db67c817 100644 (file)
@@ -137,7 +137,7 @@ unsigned int udbg_probe_uart_speed(void __iomem *comport, unsigned int clock)
        speed = (clock / prescaler) / (divisor * 16);
 
        /* sanity check */
-       if (speed < 9600 || speed > 115200)
+       if (speed < 0 || speed > (clock / 16))
                speed = 9600;
 
        return speed;