From: Justin Pettit Date: Tue, 14 Oct 2008 06:45:29 +0000 (-0700) Subject: Remove unnecessary check for validity when dereferencing an array. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26819fe177cb411e7af99dfbcd341c8fdef4205b;p=openvswitch Remove unnecessary check for validity when dereferencing an array. Thanks to Masa et al. for pointing this out. --- diff --git a/switch/datapath.c b/switch/datapath.c index 9ec768d6..4321f94f 100644 --- a/switch/datapath.c +++ b/switch/datapath.c @@ -686,7 +686,7 @@ dp_update_port_flags(struct datapath *dp, const struct ofp_port_mod *opm) struct sw_port *p = &dp->ports[port_no]; /* Make sure the port id hasn't changed since this was sent */ - if (!p || memcmp(opm->hw_addr, netdev_get_etheraddr(p->netdev), + if (memcmp(opm->hw_addr, netdev_get_etheraddr(p->netdev), ETH_ADDR_LEN) != 0) { return; }