From 15a0ca65f341c2298e571052eb68d8a282e853a5 Mon Sep 17 00:00:00 2001 From: Pravin B Shelar Date: Sat, 19 Dec 2015 22:21:56 -0800 Subject: [PATCH 1/1] datapath: stt: Fix error handling in stt_start(). The bug was reported by Joe Stringer. Signed-off-by: Pravin B Shelar Acked-by: Jesse Gross --- datapath/linux/compat/stt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/datapath/linux/compat/stt.c b/datapath/linux/compat/stt.c index 1500a76b3..8e001125b 100644 --- a/datapath/linux/compat/stt.c +++ b/datapath/linux/compat/stt.c @@ -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); -- 2.20.1