Commit 722c902a authored by Todd Poynor's avatar Todd Poynor Committed by Greg Kroah-Hartman

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: default avatarZhongze Hu <frankhu@chromium.org>
Signed-off-by: default avatarTodd Poynor <toddpoynor@google.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ba658584
......@@ -371,7 +371,9 @@ int gasket_register_device(const struct gasket_driver_desc *driver_desc)
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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment