Patchwork [net-next] net: ipv6: proc: Fix error handling

login
register
mail settings
Submitter Igor Maravić
Date Dec. 16, 2011, 12:05 p.m.
Message ID <1324037139-3626-1-git-send-email-igorm@etf.rs>
Download mbox | patch
Permalink /patch/131816/
State Rejected
Delegated to: David Miller
Headers show

Comments

Igor Maravić - Dec. 16, 2011, 12:05 p.m.
From: Igor Maravic <igorm@etf.rs>

Fix error handling in case making of dir dev_snmp6 failes

Signed-off-by: Igor Maravic <igorm@etf.rs>
---
 net/ipv6/proc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Eric Dumazet - Dec. 16, 2011, 12:21 p.m.
Le vendredi 16 décembre 2011 à 13:05 +0100, igorm@etf.rs a écrit :
> From: Igor Maravic <igorm@etf.rs>
> 
> Fix error handling in case making of dir dev_snmp6 failes
> 
> Signed-off-by: Igor Maravic <igorm@etf.rs>
> ---
>  net/ipv6/proc.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
> index fdeb6d0..6df9035 100644
> --- a/net/ipv6/proc.c
> +++ b/net/ipv6/proc.c
> @@ -307,10 +307,10 @@ static int __net_init ipv6_proc_init_net(struct net *net)
>  		goto proc_dev_snmp6_fail;
>  	return 0;
>  
> +proc_dev_snmp6_fail:
> +	proc_net_remove(net, "snmp6");
>  proc_snmp6_fail:
>  	proc_net_remove(net, "sockstat6");
> -proc_dev_snmp6_fail:
> -	proc_net_remove(net, "dev_snmp6");
>  	return -ENOMEM;
>  }
>  

Good catch, thanks !

(Should probably be applied on net tree, not net-next)

Acked-by: Eric Dumazet <eric.dumazet@gmail.com>



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
index fdeb6d0..6df9035 100644
--- a/net/ipv6/proc.c
+++ b/net/ipv6/proc.c
@@ -307,10 +307,10 @@  static int __net_init ipv6_proc_init_net(struct net *net)
 		goto proc_dev_snmp6_fail;
 	return 0;
 
+proc_dev_snmp6_fail:
+	proc_net_remove(net, "snmp6");
 proc_snmp6_fail:
 	proc_net_remove(net, "sockstat6");
-proc_dev_snmp6_fail:
-	proc_net_remove(net, "dev_snmp6");
 	return -ENOMEM;
 }