mfd: Fix allocation size of tps65217 platform data
Subsystems (2)
PATCH 1/1 mfd: Fix allocation size of tps65217 platform data
tps65217_parse_dt() allocates a struct tps65217_board for each regulator specified in the device tree. the structure itself provides arrays for the pointers to the regulator init data and the regulator device tree node, so only one instance of it is needed
This patch is based on the mfd tree
--- drivers/mfd/tps65217.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/tps65217.c +1 -1
@@ -162,7 +162,7 @@ static struct tps65217_board *tps65217_parse_dt(struct i2c_client *client)return NULL ; count = ret; - pdata =devm_kzalloc (&client->dev, count *sizeof (*pdata),GFP_KERNEL ); + pdata =devm_kzalloc (&client->dev,sizeof (*pdata),GFP_KERNEL );if (!pdata)return NULL ;
Signature · 1 line
1.7.10
Hi Matthias,
Can you comment on my latest patch? So that I can fix this issue on the same.
https://patchwork.kernel.org/patch/1220151/
Thanks
AnilKumar
Quoted 29 lines · Matthias Kaehlcke
tps65217_parse_dt()allocates a structtps65217_boardfor each regulator specified in the device tree. the structure itself provides arrays for the pointers to the regulator init data and the regulator device tree node, so only one instance of it is neededThis patch is based on the mfd tree
Signed-off-by Matthias Kaehlcke <[email protected]>--- drivers/mfd/tps65217.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/mfd/tps65217.c +1
-1@@ -162,7 +162,7 @@ static struct tps65217_board *tps65217_parse_dt(struct i2c_client *client)return NULL ; count = ret; - pdata =devm_kzalloc (&client->dev, count *sizeof (*pdata),GFP_KERNEL ); + pdata =devm_kzalloc (&client->dev,sizeof (*pdata),GFP_KERNEL );if (!pdata)return NULL ;Signature · 1 line
1.7.10