Skip to contentSkip to conversation

rtase: Fix error code in rtase_init_board()

PATCH Applied Dan Carpenter 3 participants 3 messages Sep 12, 2024 – Sep 14, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 drivers/net/ethernet/realtek/rtase/rtase_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/realtek/rtase/rtase_main.c +2 -1
index 7882f2c0e1a4..ffebc67cba5a 100644
@@ -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;
 	}
Signature · 1 line
2.45.2
#2 lore raw
In reply to Dan Carpenter
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Thu, 12 Sep 2024 11:57:06 +0300 you wrote:

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")
---
 drivers/net/ethernet/realtek/rtase/rtase_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Here is the summary with links:
- [net-next] rtase: Fix error code in rtase_init_board()

    https://git.kernel.org/netdev/net-next/c/37551b4540bd

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html