On Wed, Jun 22, 2016 at 06:11:00PM +0200, ggar...@abra.uab.cat wrote: > +int __vsock_remove_tap(struct vsock_tap *vt) {
This function should be static, it's not used outside this source file. > +static int __vsock_deliver_tap_skb(struct sk_buff *skb, > + struct net_device *dev) > +{ > + int ret = 0; > + > + if (skb) { > + dev_hold(dev); I don't understand the need for this dev_hold()/dev_put(). Can anyone explain why it is necessary? > + /* Take skb ownership so it is not consumed in dev_queue_xmit. > + * dev_queue_xmit will drop a reference so the reference count > + * will reset. > + */ > + skb_get(skb); > + skb->dev = dev; > + ret = dev_queue_xmit(skb); > + if (unlikely(ret > 0)) > + ret = net_xmit_errno(ret); > + > + dev_put(dev); > + } > + > + return ret; > +}
signature.asc
Description: PGP signature