diff mbox series

[v2] net: korina: fix return value

Message ID 20201214220952.19935-1-vincent.stehle@laposte.net (mailing list archive)
State Accepted
Delegated to: Netdev Maintainers
Headers show
Series [v2] net: korina: fix return value | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Guessed tree name to be net-next
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link
netdev/stable success Stable not CCed

Commit Message

Vincent Stehlé Dec. 14, 2020, 10:09 p.m. UTC
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(-)

Comments

Jakub Kicinski Dec. 16, 2020, 8:43 p.m. UTC | #1
On Mon, 14 Dec 2020 23:09:52 +0100 Vincent Stehlé wrote:
> 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>

Let me CC Florian's more recent email just in case he wants to review.

> 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;
>  		}
>  	}
>
Florian Fainelli Dec. 16, 2020, 9:32 p.m. UTC | #2
On 12/16/20 12:43 PM, Jakub Kicinski wrote:
> On Mon, 14 Dec 2020 23:09:52 +0100 Vincent Stehlé wrote:
>> 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>
> 
> Let me CC Florian's more recent email just in case he wants to review.

Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Jakub Kicinski Dec. 16, 2020, 11:02 p.m. UTC | #3
On Wed, 16 Dec 2020 13:32:26 -0800 Florian Fainelli wrote:
> On 12/16/20 12:43 PM, Jakub Kicinski wrote:
> > On Mon, 14 Dec 2020 23:09:52 +0100 Vincent Stehlé wrote:  
> >> 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>  
> > 
> > Let me CC Florian's more recent email just in case he wants to review.  
> 
> Acked-by: Florian Fainelli <f.fainelli@gmail.com>


diff mbox series

Patch

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