forked from MIrrors/gasket-driver
staging: gasket: hold mutex on gasket driver unregistration
Take the global mutex on driver unregistration updates for proper ordering of updates and consistent access procedures. Signed-off-by: Zhongze Hu <frankhu@chromium.org> Signed-off-by: Todd Poynor <toddpoynor@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Alex Van Damme
parent
dc5522d1dc
commit
d57203b516
@@ -371,7 +371,9 @@ fail1:
|
||||
class_destroy(internal->class);
|
||||
|
||||
unregister_gasket_driver:
|
||||
mutex_lock(&g_mutex);
|
||||
g_descs[desc_idx].driver_desc = NULL;
|
||||
mutex_unlock(&g_mutex);
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(gasket_register_device);
|
||||
@@ -408,7 +410,9 @@ void gasket_unregister_device(const struct gasket_driver_desc *driver_desc)
|
||||
class_destroy(internal_desc->class);
|
||||
|
||||
/* Finally, effectively "remove" the driver. */
|
||||
mutex_lock(&g_mutex);
|
||||
g_descs[desc_idx].driver_desc = NULL;
|
||||
mutex_unlock(&g_mutex);
|
||||
|
||||
gasket_nodev_info("removed %s driver", driver_desc->name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user