Merge 3.3-rc2 into the driver-core-next branch.
[linux-3.10.git] / drivers / base / bus.c
index 40fb122..26a06b8 100644 (file)
@@ -1194,13 +1194,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) {