Commit 2b31594a authored by Jonghwan Choi's avatar Jonghwan Choi Committed by Greg Kroah-Hartman

driver-core: Fix possible null reference in subsys_interface_unregister

Check if the sif is not NULL before de-referencing it
Signed-off-by: default avatarJonghwan Choi <jhbird.choi@samsung.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c56d8a73
......@@ -1193,13 +1193,15 @@ EXPORT_SYMBOL_GPL(subsys_interface_register);
void subsys_interface_unregister(struct subsys_interface *sif)
{
struct bus_type *subsys = sif->subsys;
struct bus_type *subsys;
struct subsys_dev_iter iter;
struct device *dev;
if (!sif)
if (!sif || !sif->subsys)
return;
subsys = sif->subsys;
mutex_lock(&subsys->p->mutex);
list_del_init(&sif->node);
if (sif->remove_dev) {
......
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