lkml.org 
[lkml]   [2012]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v6 1/3] spi/pl022: Add chip select handling via GPIO
From
Hi Roland,

On Wed, Aug 22, 2012 at 7:19 PM, Roland Stigge <stigge@antcom.de> wrote:
> @@ -2016,6 +2030,8 @@ pl022_probe(struct amba_device *adev, co
> pl022->master_info = platform_info;
> pl022->adev = adev;
> pl022->vendor = id->data;
> + /* Point chipselects to allocated memory beyond the main struct */
> + pl022->chipselects = (int *) pl022 + sizeof(struct pl022);

This is going beyond memory allocated for chipselects
as it adds 4 * sizeof(struct pl022) bytes to pl022.

pl022->chipselects = (int *) &pl022[1];
can be musch safer.

--
regards
Shiraz Hashim


\
 
 \ /
  Last update: 2012-09-01 13:21    [from the cache]
©2003-2011 Jasper Spaans