commit | d5a1036b11533e8908185ef6e03bf319ae1f1516 | [log] [tgz] |
---|---|---|
author | Josh Gao <jmgao@google.com> | Thu Jun 01 15:34:21 2017 -0700 |
committer | Josh Gao <jmgao@google.com> | Wed Jun 07 11:06:53 2017 -0700 |
tree | baa4a3d6675587c3af4bc89f6209ed846d512936 | |
parent | b4195f145a8641b28e18634783f6d77d61a3d0d7 [diff] |
adb: improve race between device_connected and device_disconnected. If a device is unplugged while it's being processed, we can be inside register_usb_transport still when we call unregister_usb_transport, leading to bad things happening. Move the call of register_usb_transport into the scope guarded by usb_handles_mutex. Bug: http://b/62200735 Test: manual Change-Id: I2517dcb9d30d9a08cebbb5f715ae3fd30c510109