linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Subhash Jadavani <subhashj@codeaurora.org>
To: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Vinayak Holikatti <vinholikatti@gmail.com>,
	"James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Yaniv Gardi <ygardi@codeaurora.org>,
	Vivek Gautam <vivek.gautam@codeaurora.org>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org, linux-scsi-owner@vger.kernel.org
Subject: Re: [PATCH v2] ufs: qcom: Properly clear hba priv on failure
Date: Mon, 21 Nov 2016 10:33:32 -0800	[thread overview]
Message-ID: <2a5a8cf3b6eb25c4def4a03d879208e3@codeaurora.org> (raw)
In-Reply-To: <1479623691-7612-1-git-send-email-bjorn.andersson@linaro.org>

On 2016-11-19 22:34, Bjorn Andersson wrote:
> ufs_qcom_init() sets the hba priv data before attempting to acquire the
> phy handle, so make sure to clear this in the case of an error. Failing
> to do this will make ufs_qcom_setup_clocks() operate on the 
> uninitalized
> host object.
> 
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
>  drivers/scsi/ufs/ufs-qcom.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c
> index d345434b084f..4de372d271b0 100644
> --- a/drivers/scsi/ufs/ufs-qcom.c
> +++ b/drivers/scsi/ufs/ufs-qcom.c
> @@ -1197,12 +1197,12 @@ static int ufs_qcom_init(struct ufs_hba *hba)
>  	if (IS_ERR(host->generic_phy)) {
>  		err = PTR_ERR(host->generic_phy);
>  		dev_err(dev, "%s: PHY get failed %d\n", __func__, err);
> -		goto out;
> +		goto out_variant_clear;
>  	}
> 
>  	err = ufs_qcom_bus_register(host);
>  	if (err)
> -		goto out_host_free;
> +		goto out_variant_clear;
> 
>  	ufs_qcom_get_controller_revision(hba, &host->hw_ver.major,
>  		&host->hw_ver.minor, &host->hw_ver.step);
> @@ -1267,7 +1267,7 @@ static int ufs_qcom_init(struct ufs_hba *hba)
>  	phy_power_off(host->generic_phy);
>  out_unregister_bus:
>  	phy_exit(host->generic_phy);
> -out_host_free:
> +out_variant_clear:
>  	ufshcd_set_variant(hba, NULL);
>  out:
>  	return err;

Looks good to me.
Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

  reply	other threads:[~2016-11-21 18:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-20  6:34 [PATCH v2] ufs: qcom: Properly clear hba priv on failure Bjorn Andersson
2016-11-21 18:33 ` Subhash Jadavani [this message]
2016-11-22  3:41 ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2a5a8cf3b6eb25c4def4a03d879208e3@codeaurora.org \
    --to=subhashj@codeaurora.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi-owner@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=vinholikatti@gmail.com \
    --cc=vivek.gautam@codeaurora.org \
    --cc=ygardi@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).