diff options
-rw-r--r-- | net/core/dst.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/core/dst.c b/net/core/dst.c index 09c1530f4681..57bc4d5b8d08 100644 --- a/net/core/dst.c +++ b/net/core/dst.c | |||
@@ -263,9 +263,11 @@ again: | |||
263 | void dst_release(struct dst_entry *dst) | 263 | void dst_release(struct dst_entry *dst) |
264 | { | 264 | { |
265 | if (dst) { | 265 | if (dst) { |
266 | WARN_ON(atomic_read(&dst->__refcnt) < 1); | 266 | int newrefcnt; |
267 | |||
267 | smp_mb__before_atomic_dec(); | 268 | smp_mb__before_atomic_dec(); |
268 | atomic_dec(&dst->__refcnt); | 269 | newrefcnt = atomic_dec_return(&dst->__refcnt); |
270 | WARN_ON(newrefcnt < 0); | ||
269 | } | 271 | } |
270 | } | 272 | } |
271 | EXPORT_SYMBOL(dst_release); | 273 | EXPORT_SYMBOL(dst_release); |