dev_kfree_skb() and skb_device_unlock()

Stephen R. van den Berg (srb@cuci.nl)
Sun, 21 Sep 1997 02:01:59 +0200


In v2.0.31pre9 arp.c (arp_find()), I find code snippets like:

if (skb != NULL && !entry) {
skb_device_unlock(skb); /* else it is lost forever */
dev_kfree_skb(skb, FREE_WRITE);
}

I always thought that "thou shalt not call dev_kfree_skb() on
unlocked skbs", but apparently this violates that rule.
What purpose does it serve to make sure that the buffer is unlocked?
If it's unlocked, doesn't this mean that someone else could be starting
to use it behind our back just as we try to free it?