summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@linaro.org>2024-09-12 11:57:06 +0300
committerJakub Kicinski <kuba@kernel.org>2024-09-13 21:23:43 -0700
commit37551b4540bdc14c9fc530eca824124cf4ccfd35 (patch)
treebae5e3d9fc99f9af2bdcde48cfa1a36d2942d3c0
parent1b8c9cb3151a541a4197d2bb449233064f747832 (diff)
rtase: Fix error code in rtase_init_board()
Return an error if dma_set_mask_and_coherent() fails. Don't return success. Fixes: a36e9f5cfe9e ("rtase: Add support for a pci table in this module") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/f53ed942-5ac2-424b-a1ed-9473c599905e@stanley.mountain Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--drivers/net/ethernet/realtek/rtase/rtase_main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/realtek/rtase/rtase_main.c b/drivers/net/ethernet/realtek/rtase/rtase_main.c
index 869183e1565e..f8777b7663d3 100644
--- a/drivers/net/ethernet/realtek/rtase/rtase_main.c
+++ b/drivers/net/ethernet/realtek/rtase/rtase_main.c
@@ -2023,7 +2023,8 @@ static int rtase_init_board(struct pci_dev *pdev, struct net_device **dev_out,
if (ret < 0)
goto err_out_disable;
- if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64))) {
+ ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+ if (ret) {
dev_err(&pdev->dev, "no usable dma addressing method\n");
goto err_out_free_res;
}