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]
Message-Id: <20080524123527.04794974.sfr@canb.auug.org.au>
Date:	Sat, 24 May 2008 12:35:27 +1000
From:	Stephen Rothwell <sfr@...b.auug.org.au>
To:	Anton Vorontsov <avorontsov@...mvista.com>
Cc:	Pierre Ossman <drzeus-mmc@...eus.cx>,
	David Brownell <dbrownell@...rs.sourceforge.net>,
	Grant Likely <grant.likely@...retlab.ca>,
	linuxppc-dev@...abs.org, Gary Jennejohn <garyj@...x.de>,
	Guennadi Liakhovetski <g.liakhovetski@....de>,
	linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 2/2] mmc: add OpenFirmware bindings for the mmc_spi
 driver

Hi Anton,

On Fri, 23 May 2008 22:28:42 +0400 Anton Vorontsov <avorontsov@...mvista.com> wrote:
>
> +++ b/drivers/mmc/host/of_mmc_spi.c

> +static int of_mmc_spi_probe(struct spi_device *spi)

> +	/*
> +	 * mmc_spi_probe will use drvdata, so we can't use it. Use node's
> +	 * data instead.
> +	 */
> +	spi->dev.archdata.of_node->data = oms;

If you delay this assignment, you may not have to clean it up in the
error path.

> +	ocr_mask = of_get_property(np, "linux,mmc-ocr-mask", &size);

You should really explicitly include linux/of.h to use of_get_property etc

> +int __devexit of_mmc_spi_remove(struct spi_device *spi)
> +{
> +	struct of_mmc_spi *oms = spi->dev.archdata.of_node->data;
> +	int ret;
> +
> +	ret = mmc_spi_remove(spi);
> +	if (ret)
> +		return ret;

Maybe you should do this last so that you don't leak more than necessary
if mmc_spi_remove fails.  (I don't know what state mmc_spi_remove leaves
stuff in if it fails ...)

> +static struct spi_driver of_mmc_spi_driver = {
> +	.driver = {
> +		.name = "of_mmc_spi",
> +		.bus = &spi_bus_type,

This is initialised by spi_register_driver().

-- 
Cheers,
Stephen Rothwell                    sfr@...b.auug.org.au
http://www.canb.auug.org.au/~sfr/

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ