[ovs-dev,v2] netdev-dpdk: Don't use dev->vhost_id without mutex.
diff mbox

Message ID 1481006707-8843-1-git-send-email-i.maximets@samsung.com
State Accepted
Delegated to: Ben Pfaff
Headers show

Commit Message

Ilya Maximets Dec. 6, 2016, 6:45 a.m. UTC
The copy should be used here.
Additionally, 'strlen' changed to the faster check.

Fixes: 821b86649a90 ("netdev-dpdk: Don't try to unregister empty vhost_id.")
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
---
Version 2:
	* 'strlen' --> '[0]' (Suggested by Ben Pfaff)

 lib/netdev-dpdk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ben Pfaff Dec. 6, 2016, 5:39 p.m. UTC | #1
On Tue, Dec 06, 2016 at 09:45:07AM +0300, Ilya Maximets wrote:
> The copy should be used here.
> Additionally, 'strlen' changed to the faster check.
> 
> Fixes: 821b86649a90 ("netdev-dpdk: Don't try to unregister empty vhost_id.")
> Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
> ---
> Version 2:
> 	* 'strlen' --> '[0]' (Suggested by Ben Pfaff)

Thanks, applied to master and branch-2.6.

Patch
diff mbox

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 6e5cd43..61d7aa3 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -1027,7 +1027,7 @@  netdev_dpdk_vhost_destruct(struct netdev *netdev)
     ovs_mutex_unlock(&dev->mutex);
     ovs_mutex_unlock(&dpdk_mutex);
 
-    if (!strlen(dev->vhost_id)) {
+    if (!vhost_id[0]) {
         goto out;
     }