netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] drivers:net: fix return value check in be_lancer_xmit_workarounds
@ 2023-07-17 14:45 Yuanjun Gong
  2023-07-17 19:32 ` Kuniyuki Iwashima
  0 siblings, 1 reply; 7+ messages in thread
From: Yuanjun Gong @ 2023-07-17 14:45 UTC (permalink / raw)
  To: Yuanjun Gong, Ajit Khaparde, Sriharsha Basavapatna, Somnath Kotur,
	netdev

in be_lancer_xmit_workarounds, it should go to label 'err' if
an unexpected value is returned by pskb_trim.

Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com>
---
 drivers/net/ethernet/emulex/benet/be_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 18c2fc880d09..eba29a2e0e8b 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -1138,7 +1138,8 @@ static struct sk_buff *be_lancer_xmit_workarounds(struct be_adapter *adapter,
 	    (lancer_chip(adapter) || BE3_chip(adapter) ||
 	     skb_vlan_tag_present(skb)) && is_ipv4_pkt(skb)) {
 		ip = (struct iphdr *)ip_hdr(skb);
-		pskb_trim(skb, eth_hdr_len + ntohs(ip->tot_len));
+		if (unlikely(pskb_trim(skb, eth_hdr_len + ntohs(ip->tot_len))))
+			goto err;
 	}
 
 	/* If vlan tag is already inlined in the packet, skip HW VLAN
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-07-27  8:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-17 14:45 [PATCH 1/1] drivers:net: fix return value check in be_lancer_xmit_workarounds Yuanjun Gong
2023-07-17 19:32 ` Kuniyuki Iwashima
2023-07-19 20:16   ` Simon Horman
2023-07-25  3:27   ` [PATCH net v2 1/1] benet: fix return value check in be_lancer_xmit_workarounds() Yuanjun Gong
2023-07-25 18:00     ` Alexander H Duyck
2023-07-27  8:31       ` Paolo Abeni
2023-07-27  8:50     ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).