lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 29 Mar 2019 19:03:55 +0530
From:   Mukesh Ojha <mojha@...eaurora.org>
To:     laurentiu.tudor@....com, linux-i2c@...r.kernel.org,
        wsa+renesas@...g-engineering.com
Cc:     linux-kernel@...r.kernel.org, leoyang.li@....com,
        linux-imx@....com, kernel@...gutronix.de,
        linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH] i2c: imx: don't leak the i2c adapter on error


On 3/29/2019 6:18 PM, laurentiu.tudor@....com wrote:
> From: Laurentiu Tudor <laurentiu.tudor@....com>
>
> Make sure to free the i2c adapter on the error exit path.
>
> Signed-off-by: Laurentiu Tudor <laurentiu.tudor@....com>
Reviewed-by: Mukesh Ojha <mojha@...eaurora.org>

Cheers,
-Mukesh
> ---
>   drivers/i2c/busses/i2c-imx.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
> index 42fed40198a0..2dfd33f48cd8 100644
> --- a/drivers/i2c/busses/i2c-imx.c
> +++ b/drivers/i2c/busses/i2c-imx.c
> @@ -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:

Powered by blists - more mailing lists