Skip to content

Commit

Permalink
spi: takes size of a pointer to determine the size of the pointed-to …
Browse files Browse the repository at this point in the history
…type

Do not take the size of a pointer to determine the size of the pointed-to
type.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Cc: David Brownell <david-b@pacbell.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Kumar Gala <galak@gate.crashing.org>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Roel Kluin authored and Linus Torvalds committed Jun 17, 2009
1 parent 08604bd commit 0214154
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/spi/spi_mpc83xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -711,12 +711,12 @@ static int of_mpc83xx_spi_get_chipselects(struct device *dev)
return 0;
}

pinfo->gpios = kmalloc(ngpios * sizeof(pinfo->gpios), GFP_KERNEL);
pinfo->gpios = kmalloc(ngpios * sizeof(*pinfo->gpios), GFP_KERNEL);
if (!pinfo->gpios)
return -ENOMEM;
memset(pinfo->gpios, -1, ngpios * sizeof(pinfo->gpios));
memset(pinfo->gpios, -1, ngpios * sizeof(*pinfo->gpios));

pinfo->alow_flags = kzalloc(ngpios * sizeof(pinfo->alow_flags),
pinfo->alow_flags = kzalloc(ngpios * sizeof(*pinfo->alow_flags),
GFP_KERNEL);
if (!pinfo->alow_flags) {
ret = -ENOMEM;
Expand Down

0 comments on commit 0214154

Please sign in to comment.