datapath: stt: Fix error handling in stt_start().
authorPravin B Shelar <pshelar@nicira.com>
Sun, 20 Dec 2015 06:21:56 +0000 (22:21 -0800)
committerPravin B Shelar <pshelar@nicira.com>
Sun, 20 Dec 2015 21:20:20 +0000 (13:20 -0800)
The bug was reported by Joe Stringer.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@kernel.org>
datapath/linux/compat/stt.c

index 1500a76..8e00112 100644 (file)
@@ -1556,10 +1556,12 @@ static int stt_start(struct net *net)
        err = nf_register_hook(&nf_hook_ops);
 #endif
        if (err)
-               goto free_percpu;
+               goto dec_n_tunnel;
        sn->n_tunnels++;
        return 0;
 
+dec_n_tunnel:
+       n_tunnels--;
 free_percpu:
        for_each_possible_cpu(i) {
                struct stt_percpu *stt_percpu = per_cpu_ptr(stt_percpu_data, i);