forked from luck/tmp_suning_uos_patched
[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:
parent
2a9529a0c8
commit
d40f6d71da
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user