Skip to content

Commit 0e479b4

Browse files
prabhakarladgregkh
authored andcommitted
serial: 8250_bcm7271: Fix return error code in case of dma_alloc_coherent() failure
In case of dma_alloc_coherent() failure return -ENOMEM instead of returning -EINVAL. Reported-by: Andy Shevchenko <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Acked-by: Florian Fainelli <[email protected]> Signed-off-by: Lad Prabhakar <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 99a507a commit 0e479b4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/tty/serial/8250/8250_bcm7271.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,15 +1075,15 @@ static int brcmuart_probe(struct platform_device *pdev)
10751075
priv->rx_size,
10761076
&priv->rx_addr, GFP_KERNEL);
10771077
if (!priv->rx_bufs) {
1078-
ret = -EINVAL;
1078+
ret = -ENOMEM;
10791079
goto err;
10801080
}
10811081
priv->tx_size = UART_XMIT_SIZE;
10821082
priv->tx_buf = dma_alloc_coherent(dev,
10831083
priv->tx_size,
10841084
&priv->tx_addr, GFP_KERNEL);
10851085
if (!priv->tx_buf) {
1086-
ret = -EINVAL;
1086+
ret = -ENOMEM;
10871087
goto err;
10881088
}
10891089
}

0 commit comments

Comments
 (0)