Skip to contentSkip to conversation

net: sunplus: Fix return type for implementation of ndo_start_xmit

PATCH RESEND Applied GUO Zihua 2 participants 2 messages Sep 2, 2022 – Sep 3, 2022

Subsystems (3)

v1 of 4 Applied 1/1 Latest is v4 →

lore
Share & tools
lore

GUO Zihua

author
#0 lore raw

PATCH RESEND 1/1 net: sunplus: Fix return type for implementation of ndo_start_xmit

Since Linux now supports CFI, it will be a good idea to fix mismatched return type for implementation of hooks. Otherwise this might get cought out by CFI and cause a panic.

spl2sw_ethernet_start_xmit() would return either NETDEV_TX_BUSY or NETDEV_TX_OK, so change the return type to netdev_tx_t directly.

---
 drivers/net/ethernet/sunplus/spl2sw_driver.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/sunplus/spl2sw_driver.c +2 -1
index 546206640492..38e478aa415c 100644
@@ -62,7 +62,8 @@ static int spl2sw_ethernet_stop(struct net_device *ndev)
 	return 0;
 }
 
-static int spl2sw_ethernet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
+static netdev_tx_t spl2sw_ethernet_start_xmit(struct sk_buff *skb,
+					      struct net_device *ndev)
 {
 	struct spl2sw_mac *mac = netdev_priv(ndev);
 	struct spl2sw_common *comm = mac->comm;
Signature · 1 line
2.17.1
#1 lore raw
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Fri, 2 Sep 2022 16:15:50 +0800 you wrote:

Since Linux now supports CFI, it will be a good idea to fix mismatched return type for implementation of hooks. Otherwise this might get cought out by CFI and cause a panic.

spl2sw_ethernet_start_xmit() would return either NETDEV_TX_BUSY or NETDEV_TX_OK, so change the return type to netdev_tx_t directly.

[...]

Here is the summary with links:
- [RESEND] net: sunplus: Fix return type for implementation of ndo_start_xmit

    https://git.kernel.org/netdev/net-next/c/7b620e156097

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html