@@ -5239,12 +5239,12 @@ void ufshcd_remove(struct ufs_hba *hba)
ufshcd_disable_intr(hba, hba->intr_mask);
ufshcd_hba_stop(hba);
- scsi_host_put(hba->host);
-
ufshcd_exit_clk_gating(hba);
if (ufshcd_is_clkscaling_enabled(hba))
devfreq_remove_device(hba->devfreq);
ufshcd_hba_exit(hba);
+
+ scsi_host_put(hba->host);
}
EXPORT_SYMBOL_GPL(ufshcd_remove);
@@ -5547,9 +5547,9 @@ exit_gating:
ufshcd_exit_clk_gating(hba);
out_disable:
hba->is_irq_enabled = false;
- scsi_host_put(host);
ufshcd_hba_exit(hba);
out_error:
+ scsi_host_put(host);
return err;
}
EXPORT_SYMBOL_GPL(ufshcd_init);
The hostdata array, which is denoted by 'hba' in ufs driver, should not be accessed after calling scsi_host_put(). Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Vinayak Holikatti <vinholikatti@gmail.com> Cc: "James E.J. Bottomley" <JBottomley@parallels.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Dolev Raviv <draviv@codeaurora.org> Cc: Sujit Reddy Thumma <sthumma@codeaurora.org> Cc: Subhash Jadavani <subhashj@codeaurora.org> Cc: Hannes Reinecke <hare@suse.de> Cc: Sahitya Tummala <stummala@codeaurora.org> Cc: linux-scsi@vger.kernel.org --- drivers/scsi/ufs/ufshcd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)