nterface-ip: remove superfluous iface check in interface_ip_set_enabled()
authorHans Dedecker <dedeckeh@gmail.com>
Thu, 26 Apr 2018 20:40:24 +0000 (22:40 +0200)
committerHans Dedecker <dedeckeh@gmail.com>
Thu, 26 Apr 2018 20:40:24 +0000 (22:40 +0200)
No need to check iface pointer in interface_ip_set_enabled as the
interface is always set by the function __interface_ip_init().
Reported by Coverity in CID 1330437

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
interface-ip.c

index 27e9e4147af91123d1d6c32059c5dc6b0b626c89..1e49fe6feac7dcf0d27278b0caedc7ee8370c7ef 100644 (file)
@@ -1442,7 +1442,7 @@ void interface_ip_set_enabled(struct interface_ip_settings *ip, bool enabled)
                        if (!strcmp(a->name, ip->iface->name))
                                interface_set_prefix_address(a, c, ip->iface, enabled);
 
-       if (ip->iface && ip->iface->policy_rules_set != enabled &&
+       if (ip->iface->policy_rules_set != enabled &&
            ip->iface->l3_dev.dev) {
                set_ip_lo_policy(enabled, true, ip->iface);
                set_ip_lo_policy(enabled, false, ip->iface);