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: <20110726112825.GB32507@valkosipuli.localdomain>
Date:	Tue, 26 Jul 2011 14:28:25 +0300
From:	Sakari Ailus <sakari.ailus@....fi>
To:	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:	linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
	Mauro Carvalho Chehab <mchehab@...radead.org>
Subject: Re: [PATCH] adp1653: check platform_data before usage

Hi, Andy!

On Mon, Jul 25, 2011 at 05:16:41PM +0300, Andy Shevchenko wrote:
> The driver requires platform_data to be present. That's why we need to check
> and fail in case of the absence of necessary data.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> Cc: Mauro Carvalho Chehab <mchehab@...radead.org>
> Cc: Sakari Ailus <sakari.ailus@....fi>
> ---
>  drivers/media/video/adp1653.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)

Thanks for the patch. I'll add this to my next pull req.

> 
> diff --git a/drivers/media/video/adp1653.c b/drivers/media/video/adp1653.c
> index be7befd..8ad89ff 100644
> --- a/drivers/media/video/adp1653.c
> +++ b/drivers/media/video/adp1653.c
> @@ -413,6 +413,10 @@ static int adp1653_probe(struct i2c_client *client,
>  	struct adp1653_flash *flash;
>  	int ret;
>  
> +	/* we couldn't work without platform data */
> +	if (client->dev.platform_data == NULL)
> +		return -ENODEV;
> +
>  	flash = kzalloc(sizeof(*flash), GFP_KERNEL);
>  	if (flash == NULL)
>  		return -ENOMEM;
> -- 
> 1.7.5.4
> 

-- 
Sakari Ailus
sakari.ailus@....fi
--
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