If vswitch_skb_checksum_setup() returns an error, the checksum
pointers probably haven't been set correctly which could cause
a crash later. We should give up immediately on error.
~skb->csum);
}
} else {
+ int err;
+
/* Add vlan header */
/* Set up checksumming pointers for checksum-deferred packets
* when we send the packet out on the wire, and it will fail at
* that point because skb_checksum_setup() will not look inside
* an 802.1Q header. */
- vswitch_skb_checksum_setup(skb);
+ err = vswitch_skb_checksum_setup(skb);
+ if (unlikely(err)) {
+ kfree_skb(skb);
+ return ERR_PTR(err);
+ }
/* GSO is not implemented for packets with an 802.1Q header, so
* we have to do segmentation before we add that header.
}
forward_ip_summed(skb);
- vswitch_skb_checksum_setup(skb);
+
+ if (unlikely(vswitch_skb_checksum_setup(skb)))
+ goto error_free;
skb = handle_gso(skb);
if (unlikely(IS_ERR(skb))) {