diff --git a/net/core/dst.c b/net/core/dst.c index 50dcdbb0ee46edc40c4fc105dc91bc8dc55492b8..477035ed7903f8ec3c816e872cd3aa4090d2bd33 100644 --- a/net/core/dst.c +++ b/net/core/dst.c @@ -262,11 +262,12 @@ struct dst_entry *dst_destroy(struct dst_entry * dst) if (dst->dev) dev_put(dst->dev); + lwtstate_put(dst->lwtstate); + if (dst->flags & DST_METADATA) kfree(dst); else kmem_cache_free(dst->ops->kmem_cachep, dst); - lwtstate_put(dst->lwtstate); dst = child; if (dst) {