vlan.c: prevent segfault in get_vlan_device_chain() if the base device does not exist
authorJo-Philipp Wich <jow@openwrt.org>
Thu, 5 Jul 2012 11:57:25 +0000 (13:57 +0200)
committerJo-Philipp Wich <jow@openwrt.org>
Thu, 5 Jul 2012 11:57:25 +0000 (13:57 +0200)
vlan.c

diff --git a/vlan.c b/vlan.c
index 9a6e2b6a4480c1458ecb9abf9c4bc6547be44d4c..785cc9e6f01ab1940ef817ec5ad06193fd61c4a7 100644 (file)
--- a/vlan.c
+++ b/vlan.c
@@ -145,7 +145,7 @@ struct device *get_vlan_device_chain(const char *ifname, bool create)
 
        s = split_vlan(buf);
        dev = device_get(buf, create);
-       if (!dev && !create)
+       if (!dev)
                goto error;
 
        do {