From f4dace9c281baa7cb133ba0bc2dd997386389eed Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sun, 13 May 2012 16:41:05 -0700 Subject: [PATCH] ovs-ofctl: Avoid impossible check for !osm in fetch_port_by_stats(). At the time of the call to ofpbuf_at(), we know that the ofp_stats_msg is present because ofputil_decode_msg_type() reported that it was. Therefore, we can use ofpbuf_at_assert() and don't have to check for a null pointer. Found by clang. Signed-off-by: Ben Pfaff --- utilities/ovs-ofctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c index c1fce83c..92808d94 100644 --- a/utilities/ovs-ofctl.c +++ b/utilities/ovs-ofctl.c @@ -620,8 +620,8 @@ fetch_port_by_stats(const char *vconn_name, verbosity + 1)); } - osm = ofpbuf_at(reply, 0, sizeof *osm); - done = !osm || !(ntohs(osm->flags) & OFPSF_REPLY_MORE); + osm = ofpbuf_at_assert(reply, 0, sizeof *osm); + done = !(ntohs(osm->flags) & OFPSF_REPLY_MORE); if (found) { /* We've already found the port, but we need to drain -- 2.30.2