UML - Fix device unplug crash
PATCH 3/6 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 <[email protected]>
--
arch/um/drivers/mconsole_kern.c | 3 +++ 1 file changed, 3 insertions(+)
arch/um/drivers/mconsole_kern.c +3 -0
@@ -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" ;