aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/core/dst.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/core/dst.c b/net/core/dst.c
index 3bf6cc434814..fc434ade5270 100644
--- a/net/core/dst.c
+++ b/net/core/dst.c
@@ -198,13 +198,15 @@ again:
198 198
199 dst = child; 199 dst = child;
200 if (dst) { 200 if (dst) {
201 int nohash = dst->flags & DST_NOHASH;
202
201 if (atomic_dec_and_test(&dst->__refcnt)) { 203 if (atomic_dec_and_test(&dst->__refcnt)) {
202 /* We were real parent of this dst, so kill child. */ 204 /* We were real parent of this dst, so kill child. */
203 if (dst->flags&DST_NOHASH) 205 if (nohash)
204 goto again; 206 goto again;
205 } else { 207 } else {
206 /* Child is still referenced, return it for freeing. */ 208 /* Child is still referenced, return it for freeing. */
207 if (dst->flags&DST_NOHASH) 209 if (nohash)
208 return dst; 210 return dst;
209 /* Child is still in his hash table */ 211 /* Child is still in his hash table */
210 } 212 }