[PATCH] uml: fix device unplug crash
authorJeff Dike <jdike@addtoit.com>
Thu, 29 Mar 2007 08:20:28 +0000 (01:20 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 29 Mar 2007 15:22:24 +0000 (08:22 -0700)
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>
arch/um/drivers/mconsole_kern.c

index 178b2ef..65ad293 100644 (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";