diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c index f8a7d9aab4372aed09dc9cd12baba0df1ce8f8ba..5fff951a0a4928ccf28fb681be86c7df6a05e94f 100644 --- a/net/dsa/dsa2.c +++ b/net/dsa/dsa2.c @@ -28,8 +28,10 @@ static struct dsa_switch_tree *dsa_get_dst(u32 tree) struct dsa_switch_tree *dst; list_for_each_entry(dst, &dsa_switch_trees, list) - if (dst->tree == tree) + if (dst->tree == tree) { + kref_get(&dst->refcount); return dst; + } return NULL; }