Skip to content

Commit

Permalink
bridge: Add assertion to document an invariant in find_local_hw_addr().
Browse files Browse the repository at this point in the history
Avoids a possible null pointer dereference report from Clang.

Reported-at: http://openvswitch.org/pipermail/dev/2016-June/073967.html
Signed-off-by: Ben Pfaff <blp@ovn.org>
Tested-by: William Tu <u9012063@gmail.com>
  • Loading branch information
blp committed Jul 5, 2016
1 parent 7a15be6 commit f57f080
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vswitchd/bridge.c
Expand Up @@ -1997,6 +1997,9 @@ find_local_hw_addr(const struct bridge *br, struct eth_addr *ea,
}
}

/* A port always has at least one interface. */
ovs_assert(iface != NULL);

/* The local port doesn't count (since we're trying to choose its
* MAC address anyway). */
if (iface->ofp_port == OFPP_LOCAL) {
Expand Down

0 comments on commit f57f080

Please sign in to comment.