Skip to contentSkip to conversation

CLK: TI: APLL: not allocating enough data

PATCH In review Dan Carpenter 2 participants 2 messages Jun 16, 2014 – Jun 19, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 CLK: TI: APLL: not allocating enough data

There is a cut and paste bug here which will lead to memory corruption because we don't allocate enough data.

Fixes 4d008589e271 ('CLK: TI: APLL: add support for omap2 aplls')
drivers/clk/ti/apll.c +1 -1
index 5428c9c..18dbaf12 100644
@@ -338,7 +338,7 @@ static void __init of_omap2_apll_setup(struct device_node *node)
 	const char *parent_name;
 	u32 val;
 
-	ad = kzalloc(sizeof(*clk_hw), GFP_KERNEL);
+	ad = kzalloc(sizeof(*ad), GFP_KERNEL);
 	clk_hw = kzalloc(sizeof(*clk_hw), GFP_KERNEL);
 	init = kzalloc(sizeof(*init), GFP_KERNEL);
 
#1 lore raw
Quoted 5 lines · Dan Carpenter

There is a cut and paste bug here which will lead to memory corruption because we don't allocate enough data.

Fixes 4d008589e271 ('CLK: TI: APLL: add support for omap2 aplls')

Thanks, queued for 3.16-rc fixes.

-Tero

Quoted 15 lines
drivers/clk/ti/apll.c +1 -1
index 5428c9c..18dbaf12 100644
@@ -338,7 +338,7 @@ static void __init of_omap2_apll_setup(struct device_node *node)
  	const char *parent_name;
  	u32 val;
 
-	ad = kzalloc(sizeof(*clk_hw), GFP_KERNEL);
+	ad = kzalloc(sizeof(*ad), GFP_KERNEL);
  	clk_hw = kzalloc(sizeof(*clk_hw), GFP_KERNEL);
  	init = kzalloc(sizeof(*init), GFP_KERNEL);