Skip to content
Snippets Groups Projects
Commit 0ef8aa75 authored by Brian Bosak's avatar Brian Bosak Committed by CQ bot account: commit-bot@chromium.org
Browse files

[zircon][ums-function] Fix deadlocks and race conditions in USB Mass Storage driver

This patch fixes the following issues in the USB Mass Storage driver:
* Double-free of the data_transfer_req_ which was corrupting
internal memory allocation structures.
* The driver now waits for any outstanding requests to complete before exiting.
This prevents a use-after-free condition.
* Immediately checks for LUNS ready before waiting. This simply speeds up the
startup time, and is useful for testing.
* Made callbacks thread-safe, by holding the txn_lock_ when invoking a callback,
and locking the queue when queuing a request.

Test: runtests -t usb-virtual-bus-test
The above test will be integrated in a future CL

Change-Id: Ie4ff8f2f70bb79fbe67b5d745b2dcde747f8bb3b
parent 45379748
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment