arm: tegra: baseband: check usb intf after resume
Vinayak Pane [Thu, 23 Feb 2012 00:55:39 +0000 (16:55 -0800)]
Check for valid interface after system resume and before
enabling runtime pm.

Bug 944052

Signed-off-by: Vinayak Pane <vpane@nvidia.com>
Reviewed-on: http://git-master/r/85330
(cherry picked from commit a32495671f104e1ba0f5a4940bde17d34b9c87f2)

Change-Id: I77dc559ac0d4b31be756d3e770c04b8e5e7bfe36
Reviewed-on: http://git-master/r/96332
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

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

index dc89813..1d5fc1e 100644 (file)
@@ -564,6 +564,10 @@ static void baseband_xmm_power_autopm_resume(struct work_struct *work)
        if (usbdev) {
                usb_lock_device(usbdev);
                intf = usb_ifnum_to_if(usbdev, 0);
+               if (!intf) {
+                       usb_unlock_device(usbdev);
+                       return;
+               }
                usb_autopm_get_interface(intf);
                usb_autopm_put_interface(intf);
                usb_unlock_device(usbdev);