summaryrefslogtreecommitdiff
path: root/net/dsa/dsa2.c
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-12-13 20:16:40 -0300
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-12-13 20:16:40 -0300
commit6baeafd1f2a54ca041ff71778ebda9fac75aad12 (patch)
tree57d2d68fa5d1d91f57cd7fcf0aed0a97892cc8cc /net/dsa/dsa2.c
parent189382f7a338c02b448ab27e1d5566e052165dc8 (diff)
Linux-libre 4.8.14-gnuHEADpck-4.8.14-gnumaster
Diffstat (limited to 'net/dsa/dsa2.c')
-rw-r--r--net/dsa/dsa2.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c
index f30bad967..3bdecd2f9 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;
}