spi: size of a pointer to determine the size of the pointed-to type
PATCH 1/1 spi: 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 Roel Kluin <[email protected]>
---
This wasn't tested, please review.
drivers/spi/spi_mpc83xx.c +3 -3
@@ -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 ;
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects