From: Dan Carpenter <dan.carpenter@oracle.com>
To: Claudiu Manoil <claudiu.manoil@nxp.com>,
Ioana Ciornei <ioana.ciornei@nxp.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Vladimir Oltean <vladimir.oltean@nxp.com>,
netdev@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH net-next] net: enetc: fix check for allocation failure
Date: Wed, 13 Oct 2021 11:04:56 +0300 [thread overview]
Message-ID: <20211013080456.GC6010@kili> (raw)
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")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/net/ethernet/freescale/enetc/enetc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c b/drivers/net/ethernet/freescale/enetc/enetc.c
index 09193b478ab3..beecb1a1276e 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc.c
@@ -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;
--
2.20.1
next reply other threads:[~2021-10-13 8:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-13 8:04 Dan Carpenter [this message]
2021-10-13 8:25 ` [PATCH net-next] net: enetc: fix check for allocation failure Ioana Ciornei
2021-10-13 23:10 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211013080456.GC6010@kili \
--to=dan.carpenter@oracle.com \
--cc=claudiu.manoil@nxp.com \
--cc=davem@davemloft.net \
--cc=ioana.ciornei@nxp.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=vladimir.oltean@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).