projects/linux·commit d40f6d71

[PATCH] uml: fix device unplug crash

d40f6d71 · Jeff Dike <[email protected]> · 2007-03-29 01:20:28 -07:00

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 <[email protected]>
Cc: Paolo 'Blaisorblade' Giarrusso <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
d40f6d71da81deb66c4fa54b46e22977cdb8b451
Parents
2a9529a0

Changes

1 files changed · +3 −0

FileStatusAddDelContent
arch/um/drivers/mconsole_kern.cmodified+3−0View file

arch/um/drivers/mconsole_kern.c

View file
diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c
index 178b2ef..65ad293 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";