[PATCH 3/3] dhcp: do not call net_unregister if net_udp_new failed

Sascha Hauer s.hauer at pengutronix.de
Mon Jun 14 03:43:44 EDT 2010


Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 net/dhcp.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/net/dhcp.c b/net/dhcp.c
index 54c5179..0771964 100644
--- a/net/dhcp.c
+++ b/net/dhcp.c
@@ -447,13 +447,13 @@ static int do_dhcp(struct command *cmdtp, int argc, char *argv[])
 
 	ret = net_udp_bind(dhcp_con, PORT_BOOTPC);
 	if (ret)
-		goto out;
+		goto out1;
 
 	net_set_ip(0);
 
 	ret = bootp_request(); /* Basically same as BOOTP */
 	if (ret)
-		goto out;
+		goto out1;
 
 	while (dhcp_state != BOUND) {
 		if (ctrlc())
@@ -464,13 +464,13 @@ static int do_dhcp(struct command *cmdtp, int argc, char *argv[])
 			printf("T ");
 			ret = bootp_request();
 			if (ret)
-				goto out;
+				goto out1;
 		}
 	}
 
-out:
+out1:
 	net_unregister(dhcp_con);
-
+out:
 	if (ret)
 		printf("dhcp failed: %s\n", strerror(-ret));
 
-- 
1.7.1




More information about the barebox mailing list