[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 <jdike@linux.intel.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Jeff Dike 2007-03-29 01:20:28 -07:00 committed by Linus Torvalds
parent 2a9529a0c8
commit d40f6d71da
1 changed files with 3 additions and 0 deletions

View File

@ -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";