summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2010-03-17 15:42:29 -0400
committerColin Cross <ccross@android.com>2010-09-29 17:49:31 -0700
commit437ae6a946a82f87f1f932e115e4e8cb58dcae5b (patch)
tree2a3845fd70e2e0ff5f90dfde610c8f89db89f44d /drivers/usb
parentfcf1d6043f34785491cc3f488c6b42e823c7d24b (diff)
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>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/android.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/android.c b/drivers/usb/gadget/android.c
index 70e48ac3e2a9..3c4d44d663c0 100644
--- a/drivers/usb/gadget/android.c
+++ b/drivers/usb/gadget/android.c
@@ -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);
}