浏览代码

ahci: imx: fix the error handling in imx_ahci_probe()

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>
Wei Yongjun 11 年之前
父节点
当前提交
7d6203af30
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      drivers/ata/ahci_imx.c

+ 2 - 1
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;
 		}
 
 		/*