Skip to content

Commit 5c85f70

Browse files
AnnYugawaPaolo Abeni
authored andcommitted
benet: fix return value check in be_lancer_xmit_workarounds()
in be_lancer_xmit_workarounds(), it should go to label 'tx_drop' if an unexpected value is returned by pskb_trim(). Fixes: 93040ae ("be2net: Fix to trim skb for padded vlan packets to workaround an ASIC Bug") Signed-off-by: Yuanjun Gong <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent ff0df20 commit 5c85f70

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/ethernet/emulex/benet/be_main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1138,7 +1138,8 @@ static struct sk_buff *be_lancer_xmit_workarounds(struct be_adapter *adapter,
11381138
(lancer_chip(adapter) || BE3_chip(adapter) ||
11391139
skb_vlan_tag_present(skb)) && is_ipv4_pkt(skb)) {
11401140
ip = (struct iphdr *)ip_hdr(skb);
1141-
pskb_trim(skb, eth_hdr_len + ntohs(ip->tot_len));
1141+
if (unlikely(pskb_trim(skb, eth_hdr_len + ntohs(ip->tot_len))))
1142+
goto tx_drop;
11421143
}
11431144

11441145
/* If vlan tag is already inlined in the packet, skip HW VLAN

0 commit comments

Comments
 (0)