Skip to content

Commit f264f2f

Browse files
Doug Bergergregkh
authored andcommitted
serial: 8250_bcm7271: fix leak in brcmuart_probe
Smatch reports: drivers/tty/serial/8250/8250_bcm7271.c:1120 brcmuart_probe() warn: 'baud_mux_clk' from clk_prepare_enable() not released on lines: 1032. The issue is fixed by using a managed clock. Fixes: 41a4694 ("serial: 8250: Add new 8250-core based Broadcom STB driver") Reported-by: XuDong Liu <m202071377@hust.edu.cn> Link: https://lore.kernel.org/lkml/20230424125100.4783-1-m202071377@hust.edu.cn/ Signed-off-by: Doug Berger <opendmb@gmail.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Link: https://lore.kernel.org/r/20230427181916.2983697-3-opendmb@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 8a3b547 commit f264f2f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/tty/serial/8250/8250_bcm7271.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ static int brcmuart_probe(struct platform_device *pdev)
10121012
of_property_read_u32(np, "clock-frequency", &clk_rate);
10131013

10141014
/* See if a Baud clock has been specified */
1015-
baud_mux_clk = of_clk_get_by_name(np, "sw_baud");
1015+
baud_mux_clk = devm_clk_get(dev, "sw_baud");
10161016
if (IS_ERR(baud_mux_clk)) {
10171017
if (PTR_ERR(baud_mux_clk) == -EPROBE_DEFER) {
10181018
ret = -EPROBE_DEFER;

0 commit comments

Comments
 (0)