serial: 8250_bcm7271: Fix return error code in case of dma_alloc_coherent() failure
authorLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Wed, 5 Jan 2022 18:07:03 +0000 (18:07 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Jan 2022 14:53:49 +0000 (15:53 +0100)
In case of dma_alloc_coherent() failure return -ENOMEM instead of
returning -EINVAL.

Reported-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://lore.kernel.org/r/20220105180704.8989-1-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_bcm7271.c

index cc60a78..9b878d0 100644 (file)
@@ -1075,7 +1075,7 @@ static int brcmuart_probe(struct platform_device *pdev)
                                                   priv->rx_size,
                                                   &priv->rx_addr, GFP_KERNEL);
                if (!priv->rx_bufs) {
-                       ret = -EINVAL;
+                       ret = -ENOMEM;
                        goto err;
                }
                priv->tx_size = UART_XMIT_SIZE;
@@ -1083,7 +1083,7 @@ static int brcmuart_probe(struct platform_device *pdev)
                                                  priv->tx_size,
                                                  &priv->tx_addr, GFP_KERNEL);
                if (!priv->tx_buf) {
-                       ret = -EINVAL;
+                       ret = -ENOMEM;
                        goto err;
                }
        }