ahci: imx: fix the error handling in imx_ahci_probe()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Sat, 7 Dec 2013 06:00:19 +0000 (14:00 +0800)
committerTejun Heo <tj@kernel.org>
Thu, 12 Dec 2013 15:59:09 +0000 (10:59 -0500)
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>
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Marek Vasut <marex@denx.de>
drivers/ata/ahci_imx.c

index 2daa28891b7f466864ae8874a83f764d9e29675c..dd4d6f74d7bd5067a62840019a53c016b74efd6e 100644 (file)
@@ -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;
                }
 
                /*