linux-um archives
 help / color / mirror / Atom feed
* [uml-devel] [PATCH 7/16] UML - Fix a shutdown hang caused by a failed ifconfig
@ 2005-03-07 20:37 Jeff Dike
  0 siblings, 0 replies; only message in thread
From: Jeff Dike @ 2005-03-07 20:37 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, user-mode-linux-devel

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>

Index: linux-2.6.11/arch/um/drivers/net_kern.c
===================================================================
--- linux-2.6.11.orig/arch/um/drivers/net_kern.c	2005-03-05 12:07:28.000000000 -0500
+++ linux-2.6.11/arch/um/drivers/net_kern.c	2005-03-05 12:12:13.000000000 -0500
@@ -728,7 +728,8 @@
 
 	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);
 	}
 }



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-03-07 18:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-07 20:37 [uml-devel] [PATCH 7/16] UML - Fix a shutdown hang caused by a failed ifconfig Jeff Dike

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox