]> Git Repo - linux.git/commitdiff
i2c: imx: don't leak the i2c adapter on error
authorLaurentiu Tudor <[email protected]>
Mon, 1 Apr 2019 10:14:37 +0000 (13:14 +0300)
committerWolfram Sang <[email protected]>
Sat, 6 Apr 2019 15:54:28 +0000 (17:54 +0200)
Make sure to free the i2c adapter on the error exit path.

Signed-off-by: Laurentiu Tudor <[email protected]>
Reviewed-by: Mukesh Ojha <[email protected]>
Reviewed-by: Uwe Kleine-König <[email protected]>
Fixes: e1ab9a468e3b ("i2c: imx: improve the error handling in i2c_imx_dma_request()")
Signed-off-by: Wolfram Sang <[email protected]>
drivers/i2c/busses/i2c-imx.c

index 42fed40198a0fb77981e90236c465c9a12bff218..c0c3043b5d6119adb0b1345c17f4dd6025b37036 100644 (file)
@@ -1169,11 +1169,13 @@ static int i2c_imx_probe(struct platform_device *pdev)
        /* Init DMA config if supported */
        ret = i2c_imx_dma_request(i2c_imx, phy_addr);
        if (ret < 0)
-               goto clk_notifier_unregister;
+               goto del_adapter;
 
        dev_info(&i2c_imx->adapter.dev, "IMX I2C adapter registered\n");
        return 0;   /* Return OK */
 
+del_adapter:
+       i2c_del_adapter(&i2c_imx->adapter);
 clk_notifier_unregister:
        clk_notifier_unregister(i2c_imx->clk, &i2c_imx->clk_change_nb);
 rpm_disable:
This page took 0.054009 seconds and 4 git commands to generate.