drivers: net: fix return value check in emac_tso_csum()
Subsystems (3)
PATCH 1/1 drivers: net: fix return value check in emac_tso_csum()
in emac_tso_csum(), return an error code if an unexpected value is returned by pskb_trim().
Signed-off-by Yuanjun Gong <[email protected]>
--- drivers/net/ethernet/qualcomm/emac/emac-mac.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/ethernet/qualcomm/emac/emac-mac.c +5 -2
@@ -1260,8 +1260,11 @@ static int emac_tso_csum(struct emac_adapter *adpt,if (skb->protocol ==htons (ETH_P_IP )) {u32 pkt_len = ((unsigned char *)ip_hdr (skb) - skb->data) +ntohs (ip_hdr (skb)->tot_len); -if (skb->len > pkt_len) -pskb_trim (skb, pkt_len); +if (skb->len > pkt_len) { + ret =pskb_trim (skb, pkt_len); +if (unlikely (ret)) +return ret; + } } hdr_len =skb_tcp_all_headers (skb);
Signature · 1 line
2.17.1
From: Yuanjun Gong <[email protected]>
Date: Mon, 17 Jul 2023 22:46:21 +0800
Quoted 4 lines
in
emac_tso_csum(), return an error code if an unexpected value is returned bypskb_trim().Signed-off-by Yuanjun Gong <[email protected]>
Fixes b9b17debc69d ("net: emac: emac gigabit ethernet controller driver")
Reviewed-by Kuniyuki Iwashima <[email protected]>
Quoted 24 lines
--- drivers/net/ethernet/qualcomm/emac/emac-mac.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)drivers/net/ethernet/qualcomm/emac/emac-mac.c +5
-2@@ -1260,8 +1260,11 @@ static int emac_tso_csum(struct emac_adapter *adpt,if (skb->protocol ==htons (ETH_P_IP )) {u32 pkt_len = ((unsigned char *)ip_hdr (skb) - skb->data) +ntohs (ip_hdr (skb)->tot_len); -if (skb->len > pkt_len) -pskb_trim (skb, pkt_len); +if (skb->len > pkt_len) { + ret =pskb_trim (skb, pkt_len); +if (unlikely (ret)) +return ret; + } } hdr_len =skb_tcp_all_headers (skb);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:21 +0800 you wrote:
in
emac_tso_csum(), return an error code if an unexpected value is returned bypskb_trim().Signed-off-by Yuanjun Gong <[email protected]>--- drivers/net/ethernet/qualcomm/emac/emac-mac.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
Here is the summary with links:
- [1/1] drivers: net: fix return value check in emac_tso_csum()
https://git.kernel.org/netdev/net/c/78a93c31003c
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
Quoted 5 lines · Yuanjun Gong
in
emac_tso_csum(), return an error code if an unexpected value is returned bypskb_trim().Signed-off-by Yuanjun Gong <[email protected]>
Acked-by Timur Tabi <[email protected]>