From: Roel Kluin Date: Tue, 16 Jun 2009 22:31:15 +0000 (-0700) Subject: spi: takes size of a pointer to determine the size of the pointed-to type X-Git-Tag: v2.6.30.1~72 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8329f58f8e68dc0c9c7c104d99207a5dd4d8eda1;p=karo-tx-linux.git spi: takes size of a pointer to determine the size of the pointed-to type commit 021415468c889979117b1a07b96f7e36de33e995 upstream. Do not take the size of a pointer to determine the size of the pointed-to type. Signed-off-by: Roel Kluin Acked-by: Anton Vorontsov Cc: David Brownell Cc: Benjamin Herrenschmidt Cc: Kumar Gala Acked-by: Grant Likely Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c index f4573a96af24..a32ccb44065e 100644 --- a/drivers/spi/spi_mpc83xx.c +++ b/drivers/spi/spi_mpc83xx.c @@ -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;