arm: tegra: baseband: Avoid matching device id if enumeration fails.
Steve Lin [Fri, 14 Dec 2012 22:20:17 +0000 (14:20 -0800)]
Bug 1197194

Change-Id: I68cd6d505478ffc226f28853ef28ad6c269ff4d5
Signed-off-by: Steve Lin <stlin@nvidia.com>
Reviewed-on: http://git-master/r/171550
Reviewed-by: Automatic_Commit_Validation_User

arch/arm/mach-tegra/tegra_usb_modem_power.c

index ab37c3d..51de0c6 100644 (file)
@@ -208,7 +208,10 @@ static void device_add_handler(struct tegra_usb_modem *modem,
 {
        const struct usb_device_descriptor *desc = &udev->descriptor;
        struct usb_interface *intf = usb_ifnum_to_if(udev, 0);
-       const struct usb_device_id *id = usb_match_id(intf, modem_list);
+       const struct usb_device_id *id = NULL;
+
+       if (intf)
+               id = usb_match_id(intf, modem_list);
 
        if (id) {
                /* hold wakelock to ensure ril has enough time to restart */