netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [SCHED] Fix unlock spinlock in error path
@ 2005-05-16 13:01 Catalin(ux aka Dino) BOIE
  2005-05-16 13:49 ` Thomas Graf
  0 siblings, 1 reply; 4+ messages in thread
From: Catalin(ux aka Dino) BOIE @ 2005-05-16 13:01 UTC (permalink / raw)
  To: netdev; +Cc: davem

[-- Attachment #1: Type: TEXT/PLAIN, Size: 394 bytes --]

Hello!

In act_api.c::tcf_action_copy_stats, in error path (get_stats
returns < 0), the spinlock taken in gnet_stats_start_copy_compat
or gnet_stats_start_copy is not unlocked.

The attached patch fixes this.

Please, apply.

Thank you very much!

Signed-off-by: Catalin(ux aka Dino) BOIE <catab at umbrella.ro>

---
Catalin(ux aka Dino) BOIE
catab at deuroconsult.ro
http://kernel.umbrella.ro/

[-- Attachment #2: Type: TEXT/PLAIN, Size: 587 bytes --]

--- linux/net/sched/act_api.c	2005-03-02 09:38:33.000000000 +0200
+++ tovbug/net/sched/act_api.c	2005-04-15 13:27:54.000000000 +0300
@@ -401,7 +401,7 @@ int tcf_action_copy_stats(struct sk_buff
 
 	if (a->ops != NULL && a->ops->get_stats != NULL)
 		if (a->ops->get_stats(skb, a) < 0)
-			goto errout;
+			goto errout_stop_stats;
 
 	if (gnet_stats_copy_basic(&d, &h->bstats) < 0 ||
 #ifdef CONFIG_NET_ESTIMATOR
@@ -415,6 +415,9 @@ int tcf_action_copy_stats(struct sk_buff
 
 	return 0;
 
+errout_stop_stats:
+	gnet_stats_finish_copy(&d);
+
 errout:
 	return -1;
 }

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-05-16 20:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-16 13:01 [PATCH] [SCHED] Fix unlock spinlock in error path Catalin(ux aka Dino) BOIE
2005-05-16 13:49 ` Thomas Graf
2005-05-16 19:25   ` Catalin(ux aka Dino) BOIE
2005-05-16 20:12     ` Thomas Graf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).