xhci: tegra: fix kernel panic in system suspend
Henry Lin [Wed, 27 Nov 2013 06:30:18 +0000 (14:30 +0800)]
If xhci driver fails to loading firmware from file during
initialization, it frees all resources it uses and set its
driver data to NULL. But xhci driver doesn't unbind it with
xhci platform device. So, system still calls tegra_xhci_suspend()
during system suspend. And, kernel panic happens when xhci
driver trying to access NULL pointer in system suspend.

Bug 1414486

Change-Id: I7b52ca01508b35f5c9c7523a75318fc3d049122b
Signed-off-by: Henry Lin <henryl@nvidia.com>
Reviewed-on: http://git-master/r/336069
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
GVS: Gerrit_Virtual_Submit

drivers/usb/host/xhci-tegra.c

index 7c0f3e8..39197d7 100644 (file)
@@ -3882,7 +3882,7 @@ static void init_filesystem_firmware_done(const struct firmware *fw,
 err_firmware_done:
        release_firmware(fw);
        mutex_unlock(&tegra->sync_lock);
-       tegra_xhci_remove(pdev);
+       device_release_driver(&pdev->dev);
 }
 
 static void deinit_filesystem_firmware(struct tegra_xhci_hcd *tegra)