From d40f6d71da81deb66c4fa54b46e22977cdb8b451 Mon Sep 17 00:00:00 2001 From: Jeff Dike Date: Thu, 29 Mar 2007 01:20:28 -0700 Subject: [PATCH] [PATCH] uml: fix device unplug crash Fix a NULL dereference when unplugging a device. The default value of err_msg wants to be "" in case the driver doesn't modify it. Signed-off-by: Jeff Dike Cc: Paolo 'Blaisorblade' Giarrusso Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/um/drivers/mconsole_kern.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c index 178b2eff4a..65ad293267 100644 --- a/arch/um/drivers/mconsole_kern.c +++ b/arch/um/drivers/mconsole_kern.c @@ -615,6 +615,9 @@ void mconsole_remove(struct mc_request *req) err_msg = NULL; err = (*dev->remove)(n, &err_msg); switch(err){ + case 0: + err_msg = ""; + break; case -ENODEV: if(err_msg == NULL) err_msg = "Device doesn't exist"; -- 2.39.5