Commit 02141546 authored by Roel Kluin's avatar Roel Kluin Committed by Linus Torvalds

spi: takes size of a pointer to determine the size of the pointed-to type

Do not take the size of a pointer to determine the size of the pointed-to
type.
Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Acked-by: default avatarAnton 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: default avatarGrant Likely <grant.likely@secretlab.ca>
Cc: <stable@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 08604bd9
...@@ -711,12 +711,12 @@ static int of_mpc83xx_spi_get_chipselects(struct device *dev) ...@@ -711,12 +711,12 @@ static int of_mpc83xx_spi_get_chipselects(struct device *dev)
return 0; return 0;
} }
pinfo->gpios = kmalloc(ngpios * sizeof(pinfo->gpios), GFP_KERNEL); pinfo->gpios = kmalloc(ngpios * sizeof(*pinfo->gpios), GFP_KERNEL);
if (!pinfo->gpios) if (!pinfo->gpios)
return -ENOMEM; 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); GFP_KERNEL);
if (!pinfo->alow_flags) { if (!pinfo->alow_flags) {
ret = -ENOMEM; ret = -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment