From: Andy Zhou Date: Tue, 18 Mar 2014 05:10:53 +0000 (-0700) Subject: dpif-netdev: init atomic flag dp->destroyed X-Git-Tag: sliver-openvswitch-2.2.90-1~6^2~89 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=1a65ba854469c6746f944b2e784100e4175e0bea;hp=566b8c8d33737e2e1978abaf5142fb7c9a1522ca;p=sliver-openvswitch.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);