
From: Jeff Dike <jdike@addtoit.com>

The network driver wasn't checking that the host side of an interface had been
successfully opened before trying to close it at shuwtdown.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/arch/um/drivers/net_kern.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff -puN arch/um/drivers/net_kern.c~uml-fix-a-shutdown-hang-caused-by-a-failed-ifconfig arch/um/drivers/net_kern.c
--- 25/arch/um/drivers/net_kern.c~uml-fix-a-shutdown-hang-caused-by-a-failed-ifconfig	2005-03-07 22:16:14.000000000 -0800
+++ 25-akpm/arch/um/drivers/net_kern.c	2005-03-07 22:16:14.000000000 -0800
@@ -728,7 +728,8 @@ static void close_devices(void)
 
 	list_for_each(ele, &opened){
 		lp = list_entry(ele, struct uml_net_private, list);
-		if(lp->close != NULL) (*lp->close)(lp->fd, &lp->user);
+		if((lp->close != NULL) && (lp->fd >= 0))
+			(*lp->close)(lp->fd, &lp->user);
 		if(lp->remove != NULL) (*lp->remove)(&lp->user);
 	}
 }
_
