login
Header Space

 
 

Re: [PATCH][NETNS]: Don't initialize err variable twice.

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <xemul@...>
Cc: <netdev@...>
Date: Monday, April 21, 2008 - 5:26 pm

From: Pavel Emelyanov <xemul@openvz.org>
Date: Mon, 21 Apr 2008 17:07:53 +0400


Applied, except that I put the initialization with the
variable declaration to save screen real-estate when
people look at this code :-)  Like so:

commit 633d424bf33dab99e77b36210fbd1b996e7823df
Author: Pavel Emelyanov <xemul@openvz.org>
Date:   Mon Apr 21 14:25:23 2008 -0700

    [NETNS]: Don't initialize err variable twice.
    
    The ip6_route_net_init() performs some unneeded actions.
    
    Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 1f42bc9..a493ad9 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2614,9 +2614,8 @@ struct ctl_table *ipv6_route_sysctl_init(struct net *net)
 
 static int ip6_route_net_init(struct net *net)
 {
-	int ret = 0;
+	int ret = -ENOMEM;
 
-	ret = -ENOMEM;
 	net->ipv6.ip6_dst_ops = kmemdup(&ip6_dst_ops_template,
 					sizeof(*net->ipv6.ip6_dst_ops),
 					GFP_KERNEL);
--
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
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH][NETNS]: Don't initialize err variable twice., Pavel Emelyanov, (Mon Apr 21, 9:07 am)
Re: [PATCH][NETNS]: Don't initialize err variable twice., YOSHIFUJI Hideaki / , (Wed Apr 23, 12:14 pm)
Re: [PATCH][NETNS]: Don't initialize err variable twice., David Miller, (Mon Apr 21, 5:26 pm)
speck-geostationary