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]>
--
 arch/um/drivers/mconsole_kern.c |    3 +++
 1 file changed, 3 insertions(+)

Index: linux-2.6.21-mm/arch/um/drivers/mconsole_kern.c
===================================================================
--- linux-2.6.21-mm.orig/arch/um/drivers/mconsole_kern.c        2007-03-27 
11:35:47.000000000 -0400
+++ linux-2.6.21-mm/arch/um/drivers/mconsole_kern.c     2007-03-27 
11:46:28.000000000 -0400
@@ -614,6 +614,9 @@ void mconsole_remove(struct mc_request *
        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";
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to