]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/serial/atmel_serial.c
atmel_serial: fix broken RX buffer allocation
[linux-2.6-omap-h63xx.git] / drivers / serial / atmel_serial.c
index d15ab2243289a088a25d7ecb7f18d699bee0ff91..e08fe64e44668d88ef325bcc5a098e0bce3fc19f 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;