scsi: ufs-qcom: Remove unnecessary devm_kfree

Resources allocated with devm_* are managed by device driver framework,
meaning the resources will be automatically released when the associated
device is removed. Besides, having a devm_kfree here would cause a
use-after-free scenario: after hba->host is freed up, data inside hba->host
shall still be accessed when device driver framework frees up all resources
associated with hba->dev. hba->host->rcdev, for example, shall be used by
func devm_reset_controller_release() when resources associated with
hba->dev are freed up.

Change-Id: I90bab41c34450a1c814d863b9f3653228f5eeb95
Signed-off-by: Can Guo <cang@codeaurora.org>
This commit is contained in:
Can Guo 2020-06-10 11:12:23 +08:00
commit c2825345ea

View file

@ -2311,7 +2311,6 @@ out_disable_vddp:
out_phy_exit:
phy_exit(host->generic_phy);
out_variant_clear:
devm_kfree(dev, host);
ufshcd_set_variant(hba, NULL);
out:
return err;