Skip to content

Commit b95a4af

Browse files
hormsdavem330
authored andcommitted
octeontx2-pf: Add error handling to VLAN unoffload handling
otx2_sq_append_skb makes used of __vlan_hwaccel_push_inside() to unoffload VLANs - push them from skb meta data into skb data. However, it omitts a check for __vlan_hwaccel_push_inside() returning NULL. Found by inspection based on [1] and [2]. Compile tested only. [1] Re: [PATCH net-next v1] net: stmmac: Enable TSO on VLANs https://lore.kernel.org/all/[email protected]/ [2] Re: [PATCH net-next v2] net: stmmac: Enable TSO on VLANs https://lore.kernel.org/all/CANn89i+11L5=tKsa7V7Aeyxaj6nYGRwy35PAbCRYJ73G+b25sg@mail.gmail.com/ Fixes: fd9d785 ("octeontx2-pf: Implement ingress/egress VLAN offload") Signed-off-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 16be004 commit b95a4af

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1174,8 +1174,11 @@ bool otx2_sq_append_skb(struct net_device *netdev, struct otx2_snd_queue *sq,
11741174

11751175
if (skb_shinfo(skb)->gso_size && !is_hw_tso_supported(pfvf, skb)) {
11761176
/* Insert vlan tag before giving pkt to tso */
1177-
if (skb_vlan_tag_present(skb))
1177+
if (skb_vlan_tag_present(skb)) {
11781178
skb = __vlan_hwaccel_push_inside(skb);
1179+
if (!skb)
1180+
return true;
1181+
}
11791182
otx2_sq_append_tso(pfvf, sq, skb, qidx);
11801183
return true;
11811184
}

0 commit comments

Comments
 (0)