Skip to content

Commit 0c8551e

Browse files
jhnikulatmlind
authored andcommitted
ARM: OMAP: mcbsp: Fix possible memory corruption
Commits 09d28d ("ARM: OMAP: mcbsp: Start generalize omap2_mcbsp_set_clks_src") and 7bc0c4 ("ARM: OMAP: mcbsp: Start generalize signal muxing functions") incorrectly set two struct omap_mcbsp_platform_data fields after omap_device_build_ss and kfree calls. Fix this by moving these pdata assignments before those calls. Signed-off-by: Jarkko Nikula <jarkko.nikula@bitmer.com> Reported-by: NeilBrown <neilb@suse.de> Signed-off-by: Tony Lindgren <tony@atomide.com>
1 parent dc47ce9 commit 0c8551e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎arch/arm/mach-omap2/mcbsp.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused)
145145
pdata->reg_size = 4;
146146
pdata->has_ccr = true;
147147
}
148+
pdata->set_clk_src = omap2_mcbsp_set_clk_src;
149+
if (id == 1)
150+
pdata->mux_signal = omap2_mcbsp1_mux_rx_clk;
148151

149152
if (oh->class->rev == MCBSP_CONFIG_TYPE3) {
150153
if (id == 2)
@@ -174,9 +177,6 @@ static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused)
174177
name, oh->name);
175178
return PTR_ERR(pdev);
176179
}
177-
pdata->set_clk_src = omap2_mcbsp_set_clk_src;
178-
if (id == 1)
179-
pdata->mux_signal = omap2_mcbsp1_mux_rx_clk;
180180
omap_mcbsp_count++;
181181
return 0;
182182
}

0 commit comments

Comments
 (0)