arm: tegra: xmm: add usb interface check
Xin Xie [Wed, 25 Jan 2012 00:56:23 +0000 (16:56 -0800)]
BUG 928909

Signed-off-by: Xin Xie <xxie@nvidia.com>
Reviewed-on: http://git-master/r/82756
(cherry picked from commit f24375055ecba7c40c740a6b88ad03e38ea8b10c)

Change-Id: I2b3d59ea433555f595a1468cae3242b7dc54958a
Signed-off-by: Xin Xie <xxie@nvidia.com>
Reviewed-on: http://git-master/r/89565
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Steve Lin <stlin@nvidia.com>

arch/arm/mach-tegra/baseband-xmm-power.c

index 1f23ea5..e428570 100644 (file)
@@ -724,7 +724,12 @@ static void baseband_xmm_power_work_func(struct work_struct *work)
 static void baseband_xmm_device_add_handler(struct usb_device *udev)
 {
        struct usb_interface *intf = usb_ifnum_to_if(udev, 0);
-       const struct usb_device_id *id = usb_match_id(intf, xmm_pm_ids);
+       const struct usb_device_id *id;
+
+       if (intf == NULL)
+               return;
+
+       id = usb_match_id(intf, xmm_pm_ids);
 
        if (id) {
                pr_debug("persist_enabled: %u\n", udev->persist_enabled);