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]
Date:	Mon, 3 Sep 2012 11:10:28 +0200
From:	Linus Walleij <linus.walleij@...aro.org>
To:	shiraz hashim <shiraz.linux.kernel@...il.com>
Cc:	Roland Stigge <stigge@...com.de>, aletes.xgr@...il.com,
	broonie@...nsource.wolfsonmicro.com, grant.likely@...retlab.ca,
	rob.herring@...xeda.com, rob@...dley.net,
	devicetree-discuss@...ts.ozlabs.org, linux-doc@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	spi-devel-general@...ts.sourceforge.net,
	gabriel.fernandez@...ricsson.com, lee.jones@...aro.org,
	viresh.kumar@...aro.org, sachin.verma@...com
Subject: Re: [PATCH v6 1/3] spi/pl022: Add chip select handling via GPIO

On Sun, Sep 2, 2012 at 3:12 PM, shiraz hashim
<shiraz.linux.kernel@...il.com> wrote:
> Hi Linus,

>> Yes that is why the allocation looks like this:
>>
>> +       master = spi_alloc_master(dev, sizeof(struct pl022) + sizeof(int) *
>> +                                 platform_info->num_chipselect);
>>
>
> The allocation is such because type of chipselects is int.
>
> The statement for allocation is correct, but
>
>        pl022->chipselects = (int *) pl022 + sizeof(struct pl022);
>
> is not adding  sizeof(struct pl022) bytes to pl022 base (which we want),
> but infact 4 times the size of pl022 (because type of pl022 is now int *).
>
> Do you get my point ?  This would go way beyond memory allocated
> for chipselects.

Yes of course ... how could I not see this. Sorry!

Yours,
Linus Walleij
--
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