diff mbox

[-next] ahci: imx: fix the error handling in imx_ahci_probe()

Message ID CAPgLHd-okGke6OMBe2yaX3NdoDFtcN-47bFfcSRL-8h_7nnmYw@mail.gmail.com
State Not Applicable
Delegated to: David Miller
Headers show

Commit Message

Wei Yongjun Dec. 7, 2013, 6 a.m. UTC
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Release alloced resources instead of direct return from
imx_ahci_probe() in the error handling case.

Fixes: 4a23d1793f8e ('ahci: imx: Add i.MX53 support')
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/ata/ahci_imx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Marek Vasut Dec. 7, 2013, 12:55 p.m. UTC | #1
On Saturday, December 07, 2013 at 07:00:19 AM, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Release alloced resources instead of direct return from
> imx_ahci_probe() in the error handling case.
> 
> Fixes: 4a23d1793f8e ('ahci: imx: Add i.MX53 support')
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Acked-by: Marek Vasut <marex@denx.de>

Nice find, thanks.

> ---
>  drivers/ata/ahci_imx.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/ata/ahci_imx.c b/drivers/ata/ahci_imx.c
> index 2daa288..dd4d6f7 100644
> --- a/drivers/ata/ahci_imx.c
> +++ b/drivers/ata/ahci_imx.c
> @@ -331,7 +331,8 @@ static int imx_ahci_probe(struct platform_device *pdev)
>  		if (IS_ERR(imxpriv->gpr)) {
>  			dev_err(dev,
>  				"failed to find fsl,imx6q-iomux-gpr regmap\n");
> -			return PTR_ERR(imxpriv->gpr);
> +			ret = PTR_ERR(imxpriv->gpr);
> +			goto err_out;
>  		}
> 
>  		/*

Best regards,
Marek Vasut
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tejun Heo Dec. 12, 2013, 3:59 p.m. UTC | #2
On Sat, Dec 07, 2013 at 02:00:19PM +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Release alloced resources instead of direct return from
> imx_ahci_probe() in the error handling case.
> 
> Fixes: 4a23d1793f8e ('ahci: imx: Add i.MX53 support')
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Applied to libata/for-3.14.

Thanks.
diff mbox

Patch

diff --git a/drivers/ata/ahci_imx.c b/drivers/ata/ahci_imx.c
index 2daa288..dd4d6f7 100644
--- a/drivers/ata/ahci_imx.c
+++ b/drivers/ata/ahci_imx.c
@@ -331,7 +331,8 @@  static int imx_ahci_probe(struct platform_device *pdev)
 		if (IS_ERR(imxpriv->gpr)) {
 			dev_err(dev,
 				"failed to find fsl,imx6q-iomux-gpr regmap\n");
-			return PTR_ERR(imxpriv->gpr);
+			ret = PTR_ERR(imxpriv->gpr);
+			goto err_out;
 		}
 
 		/*