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] [day] [month] [year] [list]
Message-ID: <2157121.3izth3cqlo@avalon>
Date:	Sun, 19 Jan 2014 21:05:34 +0100
From:	Laurent Pinchart <laurent.pinchart@...asonboard.com>
To:	Prabhakar Lad <prabhakar.csengg@...il.com>
Cc:	LMML <linux-media@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] media: i2c: mt9v032: Check return value of clk_prepare_enable/clk_set_rate

Hi Prabhakar,

Thank you for the patch.

On Friday 17 January 2014 14:52:47 Prabhakar Lad wrote:
> From: "Lad, Prabhakar" <prabhakar.csengg@...il.com>
> 
> clk_set_rate(), clk_prepare_enable() functions can fail, so check the return
> values to avoid surprises.
> 
> Signed-off-by: Lad, Prabhakar <prabhakar.csengg@...il.com>

Acked-by: Laurent Pinchart <laurent.pinchart@...asonboard.com>

I've applied the patch to my tree and will send a pull request.

> ---
>  drivers/media/i2c/mt9v032.c |   10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/i2c/mt9v032.c b/drivers/media/i2c/mt9v032.c
> index 36c504b..40172b8 100644
> --- a/drivers/media/i2c/mt9v032.c
> +++ b/drivers/media/i2c/mt9v032.c
> @@ -317,8 +317,14 @@ static int mt9v032_power_on(struct mt9v032 *mt9v032)
>  	struct i2c_client *client = v4l2_get_subdevdata(&mt9v032->subdev);
>  	int ret;
> 
> -	clk_set_rate(mt9v032->clk, mt9v032->sysclk);
> -	clk_prepare_enable(mt9v032->clk);
> +	ret = clk_set_rate(mt9v032->clk, mt9v032->sysclk);
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = clk_prepare_enable(mt9v032->clk);
> +	if (ret)
> +		return ret;
> +
>  	udelay(1);
> 
>  	/* Reset the chip and stop data read out */
-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ