Skip to content

Commit

Permalink
[PATCH] uml: fix device unplug crash
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeff Dike authored and Linus Torvalds committed Mar 29, 2007
1 parent 2a9529a commit d40f6d7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/um/drivers/mconsole_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit d40f6d7

Please sign in to comment.