diff --git a/net/core/dst.c b/net/core/dst.c index d6ead757c25895da01eb61bc9636c7e9b3cdfb3e..a6c47da7d0f8bf8a871c73aaedc21360712e03b2 100644 --- a/net/core/dst.c +++ b/net/core/dst.c @@ -299,7 +299,8 @@ EXPORT_SYMBOL_GPL(metadata_dst_alloc); void metadata_dst_free(struct metadata_dst *md_dst) { #ifdef CONFIG_DST_CACHE - dst_cache_destroy(&md_dst->u.tun_info.dst_cache); + if (md_dst->type == METADATA_IP_TUNNEL) + dst_cache_destroy(&md_dst->u.tun_info.dst_cache); #endif kfree(md_dst); }