vlan.c: prevent segfault in get_vlan_device_chain() if the base device does not exist
[project/netifd.git] / vlan.c
diff --git a/vlan.c b/vlan.c
index 9a6e2b6..785cc9e 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 {