net_sched: fix a crash in tc_new_tfilter()
[linux-2.6-microblaze.git] / net / sched / cls_api.c
index 3de47e9..d670d30 100644 (file)
@@ -717,8 +717,10 @@ static struct tcf_block *tcf_block_find(struct net *net, struct Qdisc **q,
 errout_rcu:
        rcu_read_unlock();
 errout_qdisc:
-       if (*q)
+       if (*q) {
                qdisc_put(*q);
+               *q = NULL;
+       }
        return ERR_PTR(err);
 }