Skip to contentSkip to conversation

net: enetc: fix check for allocation failure

PATCH Applied Dan Carpenter 3 participants 3 messages Oct 13, 2021

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

PATCH 1/1 net: enetc: fix check for allocation failure

This was supposed to be a check for if dma_alloc_coherent() failed but it has a copy and paste bug so it will not work.

Fixes fb8629e2cbfc ("net: enetc: add support for software TSO")
---
 drivers/net/ethernet/freescale/enetc/enetc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/freescale/enetc/enetc.c +3 -1
index 09193b478ab3..beecb1a1276e 100644
@@ -1766,8 +1766,10 @@ static int enetc_alloc_txbdr(struct enetc_bdr *txr)
 					      txr->bd_count * TSO_HEADER_SIZE,
 					      &txr->tso_headers_dma,
 					      GFP_KERNEL);
-	if (err)
+	if (!txr->tso_headers) {
+		err = -ENOMEM;
 		goto err_alloc_tso;
+	}
 
 	txr->next_to_clean = 0;
 	txr->next_to_use = 0;
Signature · 1 line
2.20.1
#2 lore raw
In reply to Dan Carpenter
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Hello:

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

Quoted 8 lines · On Wed, 13 Oct 2021 11:04:56 +0300 you wrote:

This was supposed to be a check for if dma_alloc_coherent() failed but it has a copy and paste bug so it will not work.

Fixes fb8629e2cbfc ("net: enetc: add support for software TSO")
---
 drivers/net/ethernet/freescale/enetc/enetc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Here is the summary with links:
- [net-next] net: enetc: fix check for allocation failure

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

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html