mfd: fix undefined twl4030-power resconfig value checks
[safe/jmp/linux-2.6] / net / core / dst.c
index fe03266..57bc4d5 100644 (file)
@@ -203,6 +203,7 @@ void __dst_free(struct dst_entry * dst)
        if (dst_garbage.timer_inc > DST_GC_INC) {
                dst_garbage.timer_inc = DST_GC_INC;
                dst_garbage.timer_expires = DST_GC_MIN;
+               cancel_delayed_work(&dst_gc_work);
                schedule_delayed_work(&dst_gc_work, dst_garbage.timer_expires);
        }
        spin_unlock_bh(&dst_garbage.lock);
@@ -262,9 +263,11 @@ again:
 void dst_release(struct dst_entry *dst)
 {
        if (dst) {
-               WARN_ON(atomic_read(&dst->__refcnt) < 1);
+               int newrefcnt;
+
                smp_mb__before_atomic_dec();
-               atomic_dec(&dst->__refcnt);
+               newrefcnt = atomic_dec_return(&dst->__refcnt);
+               WARN_ON(newrefcnt < 0);
        }
 }
 EXPORT_SYMBOL(dst_release);