From 1a65ba854469c6746f944b2e784100e4175e0bea Mon Sep 17 00:00:00 2001 From: Andy Zhou Date: Mon, 17 Mar 2014 22:10:53 -0700 Subject: [PATCH] dpif-netdev: init atomic flag dp->destroyed It is better to explicitly initialize the dp->destroy than to rely on xzalloc(). Signed-off-by: Andy Zhou Acked-by: Ben Pfaff --- lib/dpif-netdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 54b8f50c2..3bbfd2a7b 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -448,6 +448,7 @@ create_dp_netdev(const char *name, const struct dpif_class *class, *CONST_CAST(const struct dpif_class **, &dp->class) = class; *CONST_CAST(const char **, &dp->name) = xstrdup(name); ovs_refcount_init(&dp->ref_cnt); + atomic_flag_clear(&dp->destroyed); ovs_mutex_init(&dp->flow_mutex); classifier_init(&dp->cls, NULL); -- 2.20.1