From: Alex Wang Date: Fri, 25 Apr 2014 17:39:53 +0000 (-0700) Subject: ofproto-dpif-upcall: Fix a bug. X-Git-Tag: sliver-openvswitch-2.2.90-1~3^2~72 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=6f12bda359fb13fb2c0d6f958f56956bb76e47d7 ofproto-dpif-upcall: Fix a bug. Commit 7d170098 (ofproto-dpif-upcall: Remove the flow_dumper thread.) initialized the memory barrier inside the udpif_start_threads() function. However, the udpif_start_threads() function does not check the number of revalidator threads specified in udpif. So, when the number is zero, it causes the error in barrier initialization. This could happen when the other_config:flow-restore-wait is set and the udpif_flush() is called. This commit fixes the issue, by checking the specified number of threads in udpif_start_threads(). Reported-by: Gurucharan Shetty Signed-off-by: Alex Wang Acked-by: Gurucharan Shetty --- diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c index 84afc5600..717563a3f 100644 --- a/ofproto/ofproto-dpif-upcall.c +++ b/ofproto/ofproto-dpif-upcall.c @@ -342,7 +342,7 @@ static void udpif_start_threads(struct udpif *udpif, size_t n_handlers, size_t n_revalidators) { - if (udpif && (!udpif->handlers && !udpif->revalidators)) { + if (udpif && n_handlers && n_revalidators) { size_t i; udpif->n_handlers = n_handlers;