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: fb8629e2cb ("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>
This commit is contained in:
Dan Carpenter 2021-10-13 11:04:56 +03:00 committed by Jakub Kicinski
parent 39e222bfd7
commit e79d82643a

View File

@ -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;