[1/3] batman-adv: decrease refcount of hard-interface when it gets removed

Message ID 1286712994-30845-1-git-send-email-lindner_marek@yahoo.de (mailing list archive)
State Accepted, archived
Headers

Commit Message

Marek Lindner Oct. 10, 2010, 12:16 p.m. UTC
  Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
---
 batman-adv/hard-interface.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
  

Comments

Sven Eckelmann Oct. 11, 2010, 7:54 a.m. UTC | #1
Marek Lindner wrote:
> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
> ---
>  batman-adv/hard-interface.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/batman-adv/hard-interface.c b/batman-adv/hard-interface.c
> index ec16dc9..afc2c3d 100644
> --- a/batman-adv/hard-interface.c
> +++ b/batman-adv/hard-interface.c
> @@ -44,6 +44,7 @@ static void hardif_free_rcu(struct rcu_head *rcu)
> 
>  	batman_if = container_of(rcu, struct batman_if, rcu);
>  	sysfs_del_hardif(&batman_if->hardif_obj);
> +	dev_put(batman_if->net_dev);
>  	kref_put(&batman_if->refcount, hardif_free_ref);
>  }

Uh....

Acked-by: Sven Eckelmann <sven.eckelmann@gmx.de>
  
Marek Lindner Oct. 12, 2010, 9:47 a.m. UTC | #2
On Monday 11 October 2010 09:54:09 Sven Eckelmann wrote:
> Acked-by: Sven Eckelmann <sven.eckelmann@gmx.de>

Applied in revision 1820.

Regards,
Marek
  
Marek Lindner Oct. 12, 2010, 9:48 a.m. UTC | #3
On Tuesday 12 October 2010 11:47:00 Marek Lindner wrote:
> On Monday 11 October 2010 09:54:09 Sven Eckelmann wrote:
> > Acked-by: Sven Eckelmann <sven.eckelmann@gmx.de>
> 
> Applied in revision 1820.

Sorry, was 1823.

Regards,
Marek
  

Patch

diff --git a/batman-adv/hard-interface.c b/batman-adv/hard-interface.c
index ec16dc9..afc2c3d 100644
--- a/batman-adv/hard-interface.c
+++ b/batman-adv/hard-interface.c
@@ -44,6 +44,7 @@  static void hardif_free_rcu(struct rcu_head *rcu)
 
 	batman_if = container_of(rcu, struct batman_if, rcu);
 	sysfs_del_hardif(&batman_if->hardif_obj);
+	dev_put(batman_if->net_dev);
 	kref_put(&batman_if->refcount, hardif_free_ref);
 }