diff mbox

[ovs-dev] datapath: stt: Fix error handling in stt_start().

Message ID 1450592516-39590-1-git-send-email-pshelar@nicira.com
State Accepted
Headers show

Commit Message

Pravin B Shelar Dec. 20, 2015, 6:21 a.m. UTC
The bug was reported by Joe Stringer.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
---
 datapath/linux/compat/stt.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Jesse Gross Dec. 20, 2015, 5:07 p.m. UTC | #1
On Sun, Dec 20, 2015 at 1:21 AM, Pravin B Shelar <pshelar@nicira.com> wrote:
> The bug was reported by Joe Stringer.
>
> Signed-off-by: Pravin B Shelar <pshelar@nicira.com>

Acked-by: Jesse Gross <jesse@kernel.org>
Pravin B Shelar Dec. 20, 2015, 9:42 p.m. UTC | #2
On Sun, Dec 20, 2015 at 9:07 AM, Jesse Gross <jesse@kernel.org> wrote:
> On Sun, Dec 20, 2015 at 1:21 AM, Pravin B Shelar <pshelar@nicira.com> wrote:
>> The bug was reported by Joe Stringer.
>>
>> Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
>
> Acked-by: Jesse Gross <jesse@kernel.org>


Thanks. I pushed it to master and branch-2.5.
diff mbox

Patch

diff --git a/datapath/linux/compat/stt.c b/datapath/linux/compat/stt.c
index 1e2c26a..218177e 100644
--- a/datapath/linux/compat/stt.c
+++ b/datapath/linux/compat/stt.c
@@ -1557,10 +1557,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);