mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
USB: gadget: android: check for null _android_dev in android_register_function()
This fixes a load ordering issue that occurred if a function driver loads before the android gadget driver is initialized. Signed-off-by: Mike Lockwood <lockwood@android.com>
This commit is contained in:
@@ -313,7 +313,7 @@ void android_register_function(struct android_usb_function *f)
|
||||
/* bind our functions if they have all registered
|
||||
* and the main driver has bound.
|
||||
*/
|
||||
if (dev->config && _registered_function_count == dev->num_functions)
|
||||
if (dev && dev->config && _registered_function_count == dev->num_functions)
|
||||
bind_functions(dev);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user