From: Victor Toso <m...@victortoso.com>

Explanation on this mutex in commit 4eea5f3 in 2016-03-24 by Kirill
Moizik <kmoi...@redhat.com>. This is missing in the polkit code path
and its the major difference with _open_device_async_cb() callback.

Next patch will remove _open_device_async_cb() to keep code path for
access control mandatory there so add this lock/unlock now with some
context on why.

Signed-off-by: Victor Toso <victort...@redhat.com>
---
 src/channel-usbredir.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/channel-usbredir.c b/src/channel-usbredir.c
index 1910ff6..5214160 100644
--- a/src/channel-usbredir.c
+++ b/src/channel-usbredir.c
@@ -338,7 +338,9 @@ static void spice_usbredir_channel_open_acl_cb(
                                   "USB redirection channel connect cancelled");
     }
     if (!err) {
+        spice_usbredir_channel_lock(channel);
         spice_usbredir_channel_open_device(channel, &err);
+        spice_usbredir_channel_unlock(channel);
     }
     if (err) {
         libusb_unref_device(priv->device);
-- 
2.20.1

_______________________________________________
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel

Reply via email to