diff options
author | Jeff Dike <jdike@addtoit.com> | 2007-03-29 04:20:28 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-03-29 11:22:24 -0400 |
commit | d40f6d71da81deb66c4fa54b46e22977cdb8b451 (patch) | |
tree | d23894b3d5de54b0559239ae9eecfc91e52082af /arch/um | |
parent | 2a9529a0c890007ade5425b75272c3def283f8b1 (diff) |
[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>
Diffstat (limited to 'arch/um')
-rw-r--r-- | arch/um/drivers/mconsole_kern.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c index 178b2eff4a8c..65ad2932672c 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) | |||
615 | err_msg = NULL; | 615 | err_msg = NULL; |
616 | err = (*dev->remove)(n, &err_msg); | 616 | err = (*dev->remove)(n, &err_msg); |
617 | switch(err){ | 617 | switch(err){ |
618 | case 0: | ||
619 | err_msg = ""; | ||
620 | break; | ||
618 | case -ENODEV: | 621 | case -ENODEV: |
619 | if(err_msg == NULL) | 622 | if(err_msg == NULL) |
620 | err_msg = "Device doesn't exist"; | 623 | err_msg = "Device doesn't exist"; |