Skip to content

Commit

Permalink
net: enetc: fix check for allocation failure
Browse files Browse the repository at this point in the history
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: fb8629e ("net: enetc: add support for software TSO")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Link: https://lore.kernel.org/r/20211013080456.GC6010@kili
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Dan Carpenter authored and Jakub Kicinski committed Oct 13, 2021
1 parent 39e222b commit e79d826
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/ethernet/freescale/enetc/enetc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1767,8 +1767,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;
Expand Down

0 comments on commit e79d826

Please sign in to comment.