bridge: fix hotplug device removal
authorFelix Fietkau <nbd@openwrt.org>
Sun, 4 Mar 2012 00:18:45 +0000 (01:18 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 4 Mar 2012 00:18:45 +0000 (01:18 +0100)
bridge.c

index f2c73b0108b74e9d6f459fe992920f520a62cf30..dbfd47050d99c73deab25b2ba7b6da257a7560de 100644 (file)
--- a/bridge.c
+++ b/bridge.c
@@ -156,12 +156,12 @@ bridge_member_cb(struct device_user *dev, enum device_event ev)
 
                break;
        case DEV_EVENT_REMOVE:
-               if (!bm->present)
+               if (dev->hotplug) {
+                       vlist_delete(&bst->members, &bm->node);
                        return;
+               }
 
-               if (dev->hotplug)
-                       vlist_delete(&bst->members, &bm->node);
-               else
+               if (bm->present)
                        bridge_remove_member(bm);
 
                break;