From: "Vincent Stehlé" <vincent.stehle@laposte.net>
To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: "Julian Wiedmann" <jwi@linux.ibm.com>,
"Vincent Stehlé" <vincent.stehle@laposte.net>,
"Jakub Kicinski" <kuba@kernel.org>,
"David S . Miller" <davem@davemloft.net>,
"Florian Fainelli" <florian.fainelli@telecomint.eu>
Subject: [PATCH v2] net: korina: fix return value
Date: Mon, 14 Dec 2020 23:09:52 +0100 [thread overview]
Message-ID: <20201214220952.19935-1-vincent.stehle@laposte.net> (raw)
In-Reply-To: <20201214130832.7bedb230@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
The ndo_start_xmit() method must not attempt to free the skb to transmit
when returning NETDEV_TX_BUSY. Therefore, make sure the
korina_send_packet() function returns NETDEV_TX_OK when it frees a packet.
Fixes: ef11291bcd5f ("Add support the Korina (IDT RC32434) Ethernet MAC")
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Vincent Stehlé <vincent.stehle@laposte.net>
Cc: David S. Miller <davem@davemloft.net>
Cc: Florian Fainelli <florian.fainelli@telecomint.eu>
---
Changes since v1:
- Keep freeing the packet but return NETDEV_TX_OK, as suggested by Jakub
drivers/net/ethernet/korina.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/korina.c b/drivers/net/ethernet/korina.c
index bf48f0ded9c7d..925161959b9ba 100644
--- a/drivers/net/ethernet/korina.c
+++ b/drivers/net/ethernet/korina.c
@@ -219,7 +219,7 @@ static int korina_send_packet(struct sk_buff *skb, struct net_device *dev)
dev_kfree_skb_any(skb);
spin_unlock_irqrestore(&lp->lock, flags);
- return NETDEV_TX_BUSY;
+ return NETDEV_TX_OK;
}
}
--
2.29.2
next prev parent reply other threads:[~2020-12-14 22:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-13 17:20 [PATCH] net: korina: remove busy skb free Vincent Stehlé
2020-12-14 10:03 ` Julian Wiedmann
2020-12-14 21:08 ` Jakub Kicinski
2020-12-14 21:27 ` Vincent Stehlé
2020-12-14 22:09 ` Vincent Stehlé [this message]
2020-12-16 20:43 ` [PATCH v2] net: korina: fix return value Jakub Kicinski
2020-12-16 21:32 ` Florian Fainelli
2020-12-16 23:02 ` Jakub Kicinski
2020-12-14 21:14 ` [PATCH] net: korina: remove busy skb free Vincent Stehlé
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=20201214220952.19935-1-vincent.stehle@laposte.net \
--to=vincent.stehle@laposte.net \
--cc=davem@davemloft.net \
--cc=florian.fainelli@telecomint.eu \
--cc=jwi@linux.ibm.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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