[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
Showing
- zircon/system/dev/block/usb-mass-storage/BUILD.gn 3 additions, 0 deletionszircon/system/dev/block/usb-mass-storage/BUILD.gn
- zircon/system/dev/block/usb-mass-storage/usb-mass-storage.cpp 47 additions, 14 deletions...on/system/dev/block/usb-mass-storage/usb-mass-storage.cpp
- zircon/system/dev/block/usb-mass-storage/usb-mass-storage.h 13 additions, 0 deletionszircon/system/dev/block/usb-mass-storage/usb-mass-storage.h
Loading
Please register or sign in to comment