Skip to contentSkip to conversation

: act_api: Fix module leak while flushing actions

PKT_SCHED Applied Thomas Graf 2 participants 4 messages Jul 9, 2006 – Jul 10, 2006

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Module reference needs to be given back if message header construction fails.

net/sched/act_api.c +1 -1
Index: net-2.6.git/net/sched/act_api.c
===================================================================
@@ -602,8 +602,8 @@ static int tca_action_flush(struct rtatt
 	return err;
 
 rtattr_failure:
-	module_put(a->ops->owner);
 nlmsg_failure:
+	module_put(a->ops->owner);
 err_out:
 	kfree_skb(skb);
 	kfree(a);
maintainer Applied
#1 lore raw

From: Thomas Graf <[email protected]>
Date: Sun, 9 Jul 2006 16:20:43 +0200

Quoted 4 lines

Module reference needs to be given back if message header construction fails.

Applied, thanks Thomas.

This reminds me of something, not only are non-networking developers getting tripped up constantly about these magic code labels referenced from the netlink macros, they are tripping us up as well.

I really think it's time, at a minimum, to explicitly mention the labels as an argument to the macros, or something like that.

I'll try to cons something up when I get a chance. The current situation is too error prone.

#2 lore raw

* David Miller <[email protected]> 2006-07-09 11:38

Quoted 14 lines

From: Thomas Graf <[email protected]>
Date: Sun, 9 Jul 2006 16:20:43 +0200

Quoted 4 lines

Module reference needs to be given back if message header construction fails.

Applied, thanks Thomas.

This reminds me of something, not only are non-networking developers getting tripped up constantly about these magic code labels referenced from the netlink macros, they are tripping us up as well.

Quoted 5 lines

I really think it's time, at a minimum, to explicitly mention the labels as an argument to the macros, or something like that.

I'll try to cons something up when I get a chance. The current situation is too error prone.

I agree, that's why the new netlink api offers label free methods. The transformation patches for 2.6.19 converting all netlink users to use the new api will resolved these issues.

maintainer
#3 lore raw

From: Thomas Graf <[email protected]>
Date: Sun, 9 Jul 2006 21:57:34 +0200

Quoted 8 lines

* David Miller <[email protected]> 2006-07-09 11:38

Quoted 2 lines

I'll try to cons something up when I get a chance. The current situation is too error prone.

I agree, that's why the new netlink api offers label free methods. The transformation patches for 2.6.19 converting all netlink users to use the new api will resolved these issues.

Awesome, I look forward to seeing those patches.