Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4c63de94 authored by Gilad Broner's avatar Gilad Broner Committed by Gerrit - the friendly Code Review server
Browse files

scsi: ufs: fix probe failure masked by crypto engine reset



When ufshcd_host_reset_and_restore() is called, it is possible
that ufshcd_probe_hba() fails and return an error value.
However, the later call to crypto_engine_reset() might succeed
and override the previous error value.
This will result in ufshcd_host_reset_and_restore() returning
success while in fact a serious error may have occured which
should prevent us from continuing in the normal sequence.
Instead, call crypto_engine_reset() only if ufshcd_probe_hba()
was successfull.

Change-Id: I0462f674b8750bfb9e0657cb37833aa2bd2aa4f0
Signed-off-by: default avatarGilad Broner <gbroner@codeaurora.org>
parent 2e5123a1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5970,7 +5970,7 @@ static int ufshcd_host_reset_and_restore(struct ufs_hba *hba)
		goto out;
	}

	if (hba->vops && hba->vops->crypto_engine_reset) {
	if (!err && hba->vops && hba->vops->crypto_engine_reset) {
		err = hba->vops->crypto_engine_reset(hba);
		if (err) {
			dev_err(hba->dev,