drivers:net: fix return value check in ocelot_fdma_receive_skb
Subsystems (3)
PATCH 1/1 drivers:net: fix return value check in ocelot_fdma_receive_skb
ocelot_fdma_receive_skb should return false if an unexpected value is returned by pskb_trim.
Signed-off-by Yuanjun Gong <[email protected]>
--- drivers/net/ethernet/mscc/ocelot_fdma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/mscc/ocelot_fdma.c +2 -1
@@ -368,7 +368,8 @@ static bool ocelot_fdma_receive_skb(struct ocelot *ocelot, struct sk_buff *skb)if (unlikely (!ndev))return false; -pskb_trim (skb, skb->len -ETH_FCS_LEN ); +if (pskb_trim (skb, skb->len -ETH_FCS_LEN )) +return false; skb->dev = ndev; skb->protocol =eth_type_trans (skb, skb->dev);
Signature · 1 line
2.17.1
PATCH 1/1 drivers:net: fix return value check in ocelot_fdma_receive_skb
From: Yuanjun Gong <[email protected]>
Date: Mon, 17 Jul 2023 22:46:52 +0800
Quoted 4 lines
ocelot_fdma_receive_skbshould return false if an unexpected value is returned bypskb_trim.Signed-off-by Yuanjun Gong <[email protected]>
Fixes 753a026cfec1 ("net: ocelot: add FDMA support")
Reviewed-by Kuniyuki Iwashima <[email protected]>
Quoted 20 lines
--- drivers/net/ethernet/mscc/ocelot_fdma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/ethernet/mscc/ocelot_fdma.c +2
-1@@ -368,7 +368,8 @@ static bool ocelot_fdma_receive_skb(struct ocelot *ocelot, struct sk_buff *skb)if (unlikely (!ndev))return false; -pskb_trim (skb, skb->len -ETH_FCS_LEN ); +if (pskb_trim (skb, skb->len -ETH_FCS_LEN )) +return false; skb->dev = ndev; skb->protocol =eth_type_trans (skb, skb->dev);Signature · 1 line
2.17.1
This patch was applied to netdev/net.git (main) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by David S. Miller <[email protected]>:
Quoted 7 lines · On Mon, 17 Jul 2023 22:46:52 +0800 you wrote:
ocelot_fdma_receive_skbshould return false if an unexpected value is returned bypskb_trim.Signed-off-by Yuanjun Gong <[email protected]>--- drivers/net/ethernet/mscc/ocelot_fdma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Here is the summary with links:
- [1/1] drivers:net: fix return value check in ocelot_fdma_receive_skb
https://git.kernel.org/netdev/net/c/bce5603365d8
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html