From: Ben Pfaff Date: Fri, 6 Mar 2009 01:00:46 +0000 (-0800) Subject: dpif: Suppress spurious error from Valgrind. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8bc0fb9652488bef87f569a62431a8482c1c072e;p=openvswitch dpif: Suppress spurious error from Valgrind. --- diff --git a/lib/dpif.c b/lib/dpif.c index 0f5908fa..aa75f58c 100644 --- a/lib/dpif.c +++ b/lib/dpif.c @@ -59,6 +59,7 @@ #include "packets.h" #include "poll-loop.h" #include "util.h" +#include "valgrind.h" #include "vlog.h" #define THIS_MODULE VLM_dpif @@ -425,9 +426,13 @@ dpif_flow_list(const struct dpif *dpif, struct odp_flow flows[], size_t n, fv.flows = flows; fv.n_flows = n; - for (i = 0; i < n; i++) { - flows[i].actions = NULL; - flows[i].n_actions = 0; + if (RUNNING_ON_VALGRIND) { + memset(flows, 0, n * sizeof *flows); + } else { + for (i = 0; i < n; i++) { + flows[i].actions = NULL; + flows[i].n_actions = 0; + } } error = IOCTL(dpif, ODP_FLOW_LIST, &fv); *n_out = error ? 0 : fv.n_flows;