diff options
author | Joe Stringer <joestringer@nicira.com> | 2015-07-13 17:33:22 -0700 |
---|---|---|
committer | Joe Stringer <joestringer@nicira.com> | 2015-07-17 10:24:46 -0700 |
commit | 2bb0bea82711750311974c291e98bec6fc0e077f (patch) | |
tree | 7f1f30ca5ef67ca8a99d86e7dee79c82c9e167a9 /utilities/ovs-vsctl.c | |
parent | e8eba0ab281efe60e08acb43e3d4dea6481cdd15 (diff) | |
download | openvswitch-2bb0bea82711750311974c291e98bec6fc0e077f.tar.gz |
ovs-vsctl: Remove redundant checks.
In several places, "br" is dereferenced just before a check such as
"if (br ...)". These checks may be optimised out, and they provide no
additional safety, so this patch removes them.
Found by MIT STACK undefined behaviour checker.
Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'utilities/ovs-vsctl.c')
-rw-r--r-- | utilities/ovs-vsctl.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c index 8d62d5413..c71398e52 100644 --- a/utilities/ovs-vsctl.c +++ b/utilities/ovs-vsctl.c @@ -740,9 +740,6 @@ vsctl_context_populate_cache(struct ctl_context *ctx) continue; } br = add_bridge_to_cache(vsctl_ctx, br_cfg, br_cfg->name, NULL, 0); - if (!br) { - continue; - } for (j = 0; j < br_cfg->n_ports; j++) { struct ovsrec_port *port_cfg = br_cfg->ports[j]; @@ -2137,7 +2134,7 @@ cmd_add_aa_mapping(struct ctl_context *ctx) br = br->parent; } - if (br && br->br_cfg) { + if (br->br_cfg) { if (!br->br_cfg->auto_attach) { struct ovsrec_autoattach *aa = ovsrec_autoattach_insert(ctx->txn); ovsrec_bridge_set_auto_attach(br->br_cfg, aa); @@ -2197,7 +2194,7 @@ cmd_del_aa_mapping(struct ctl_context *ctx) br = br->parent; } - if (br && br->br_cfg && br->br_cfg->auto_attach && + if (br->br_cfg && br->br_cfg->auto_attach && br->br_cfg->auto_attach->key_mappings && br->br_cfg->auto_attach->value_mappings) { size_t i; @@ -2248,7 +2245,7 @@ cmd_get_aa_mapping(struct ctl_context *ctx) verify_auto_attach(br->br_cfg); - if (br && br->br_cfg && br->br_cfg->auto_attach && + if (br->br_cfg && br->br_cfg->auto_attach && br->br_cfg->auto_attach->key_mappings && br->br_cfg->auto_attach->value_mappings) { size_t i; |