Project

General

Profile

Feature #3220

Updated by Alexey Khoroshilov about 11 years ago

*Not disabling IO during memory allocation while holding a USB device lock* 

 *SUMMARY* 
 You should use `GFP_NOIO` instead of `GFP_KERNEL` for memory allocations between `usb_lock_device()` and `usb_unlock_device()` invocations. 

 *DESCRIPTION* 
 Memory allocations with `GFP_KERNEL` flag can cause input/output operations to a storage 
 device. These operations can fail thus requiring to reset the device. 

 Therefore `GFP_KERNEL` cannot be safely used between `usb_lock_device()` 
 and `usb_unlock_device()` incovations. It should be replaced by `GFP_NOIO`. 

 *LINKS* 
 [Sample bugfix](http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=acbe2febe71abb2360b008e9ab3ee5c44169f78c) bugfix](http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.32.y.git;a=commitdiff;h=186c74d336e2c1377df9e5dc88f7966b2dd6acf7) 

 *EXAMPLE* 
 The following drivers contain this error (in version 2.6.32): 

 * `drivers/usb/core/devices.c` 

 * `drivers/usb/core/message.c` 

Back