mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
soc: fsl: cpm1: tsa: Fix clock leak in tsa_of_parse_tdms()
The error cleanup loop puts l1rsync_clk and l1rclk_clk a second time
and never puts l1tsync_clk or l1tclk_clk, because the branches that
guard the transmit clocks use the receive clock field names.
Use the matching field in each branch so every clock acquired by
tsa_of_parse_tdms() is released exactly once.
Fixes: 1d4ba0b81c ("soc: fsl: cpm1: Add support for TSA")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Reviewed-by: Herve Codina <herve.codina@bootlin.com>
Link: https://lore.kernel.org/r/20260917152719.2160395-1-vulab@iscas.ac.cn
[chleroy: Fixed the same in tsa_remove()]
Signed-off-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
This commit is contained in:
parent
31d42d67c6
commit
46201d760c
|
|
@ -865,12 +865,12 @@ static int tsa_of_parse_tdms(struct tsa *tsa, struct device_node *np)
|
|||
clk_put(tsa->tdm[i].l1rclk_clk);
|
||||
}
|
||||
if (tsa->tdm[i].l1tsync_clk) {
|
||||
clk_disable_unprepare(tsa->tdm[i].l1rsync_clk);
|
||||
clk_put(tsa->tdm[i].l1rsync_clk);
|
||||
clk_disable_unprepare(tsa->tdm[i].l1tsync_clk);
|
||||
clk_put(tsa->tdm[i].l1tsync_clk);
|
||||
}
|
||||
if (tsa->tdm[i].l1tclk_clk) {
|
||||
clk_disable_unprepare(tsa->tdm[i].l1rclk_clk);
|
||||
clk_put(tsa->tdm[i].l1rclk_clk);
|
||||
clk_disable_unprepare(tsa->tdm[i].l1tclk_clk);
|
||||
clk_put(tsa->tdm[i].l1tclk_clk);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
|
@ -1039,12 +1039,12 @@ static void tsa_remove(struct platform_device *pdev)
|
|||
clk_put(tsa->tdm[i].l1rclk_clk);
|
||||
}
|
||||
if (tsa->tdm[i].l1tsync_clk) {
|
||||
clk_disable_unprepare(tsa->tdm[i].l1rsync_clk);
|
||||
clk_put(tsa->tdm[i].l1rsync_clk);
|
||||
clk_disable_unprepare(tsa->tdm[i].l1tsync_clk);
|
||||
clk_put(tsa->tdm[i].l1tsync_clk);
|
||||
}
|
||||
if (tsa->tdm[i].l1tclk_clk) {
|
||||
clk_disable_unprepare(tsa->tdm[i].l1rclk_clk);
|
||||
clk_put(tsa->tdm[i].l1rclk_clk);
|
||||
clk_disable_unprepare(tsa->tdm[i].l1tclk_clk);
|
||||
clk_put(tsa->tdm[i].l1tclk_clk);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user