atmel_serial: fix broken RX buffer allocation
authorHaavard Skinnemoen <hskinnemoen@atmel.com>
Fri, 8 Feb 2008 12:21:07 +0000 (04:21 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Fri, 8 Feb 2008 17:22:37 +0000 (09:22 -0800)
Introduced by atmel_serial-split-the-interrupt-handler.patch.

Thanks to michael <trimarchi@gandalf.sssup.it> for spotting it.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/serial/atmel_serial.c

index d15ab22..e08fe64 100644 (file)
@@ -1469,7 +1469,8 @@ static int __devinit atmel_serial_probe(struct platform_device *pdev)
 
        if (!atmel_use_dma_rx(&port->uart)) {
                ret = -ENOMEM;
-               data = kmalloc(ATMEL_SERIAL_RINGSIZE, GFP_KERNEL);
+               data = kmalloc(sizeof(struct atmel_uart_char)
+                               * ATMEL_SERIAL_RINGSIZE, GFP_KERNEL);
                if (!data)
                        goto err_alloc_ring;
                port->rx_ring.buf = data;