net: fix a race in dst_release()
[pandora-kernel.git] / net / core / dst.c
index d5e2c4c..946e214 100644 (file)
@@ -272,7 +272,7 @@ void dst_release(struct dst_entry *dst)
 
                newrefcnt = atomic_dec_return(&dst->__refcnt);
                WARN_ON(newrefcnt < 0);
-               if (unlikely(dst->flags & DST_NOCACHE) && !newrefcnt) {
+               if (!newrefcnt && unlikely(dst->flags & DST_NOCACHE)) {
                        dst = dst_destroy(dst);
                        if (dst)
                                __dst_free(dst);