From: Andy Zhou Date: Tue, 18 Mar 2014 05:10:53 +0000 (-0700) Subject: dpif-netdev: init atomic flag dp->destroyed X-Git-Tag: v2.3~497 X-Git-Url: http://git.cascardo.eti.br/?a=commitdiff_plain;h=1a65ba854469c6746f944b2e784100e4175e0bea;p=cascardo%2Fovs.git 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 --- 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);