mirror of
https://github.com/torvalds/linux.git
synced 2026-06-09 23:23:53 +02: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:
parent
f620564133
commit
0a4c12d4fa
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user