Found by Clang.
CC: Michal Weglicki <michalx.weglicki@intel.com>
Fixes: 971f4b394c6e ("netdev: Custom statistics.")
Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
(struct netdev_custom_counter *) xcalloc(C_STATS_SIZE,
sizeof(struct netdev_custom_counter));
+ ovs_mutex_lock(&dev->mutex);
for (i = 0 ; i < C_STATS_SIZE ; i++) {
custom_stats->counters[i].value = dev->custom_stats[i].value;
ovs_strlcpy(custom_stats->counters[i].name,
dev->custom_stats[i].name,
NETDEV_CUSTOM_STATS_NAME_SIZE);
}
+ ovs_mutex_unlock(&dev->mutex);
return 0;
}