Skip to content

Commit d8edf8e

Browse files
WillLestergregkh
authored andcommitted
serial: mxs-auart: add missed iounmap() in probe failure and remove
This driver calls ioremap() in probe, but it misses calling iounmap() in probe's error handler and remove. Add the missed calls to fix it. Fixes: 47d37d6 ("serial: Add auart driver for i.MX23/28") Signed-off-by: Chuhong Yuan <[email protected]> Cc: stable <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent f38278e commit d8edf8e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

drivers/tty/serial/mxs-auart.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1698,29 +1698,29 @@ static int mxs_auart_probe(struct platform_device *pdev)
16981698
irq = platform_get_irq(pdev, 0);
16991699
if (irq < 0) {
17001700
ret = irq;
1701-
goto out_disable_clks;
1701+
goto out_iounmap;
17021702
}
17031703

17041704
s->port.irq = irq;
17051705
ret = devm_request_irq(&pdev->dev, irq, mxs_auart_irq_handle, 0,
17061706
dev_name(&pdev->dev), s);
17071707
if (ret)
1708-
goto out_disable_clks;
1708+
goto out_iounmap;
17091709

17101710
platform_set_drvdata(pdev, s);
17111711

17121712
ret = mxs_auart_init_gpios(s, &pdev->dev);
17131713
if (ret) {
17141714
dev_err(&pdev->dev, "Failed to initialize GPIOs.\n");
1715-
goto out_disable_clks;
1715+
goto out_iounmap;
17161716
}
17171717

17181718
/*
17191719
* Get the GPIO lines IRQ
17201720
*/
17211721
ret = mxs_auart_request_gpio_irq(s);
17221722
if (ret)
1723-
goto out_disable_clks;
1723+
goto out_iounmap;
17241724

17251725
auart_port[s->port.line] = s;
17261726

@@ -1746,6 +1746,9 @@ static int mxs_auart_probe(struct platform_device *pdev)
17461746
mxs_auart_free_gpio_irq(s);
17471747
auart_port[pdev->id] = NULL;
17481748

1749+
out_iounmap:
1750+
iounmap(s->port.membase);
1751+
17491752
out_disable_clks:
17501753
if (is_asm9260_auart(s)) {
17511754
clk_disable_unprepare(s->clk);
@@ -1761,6 +1764,7 @@ static int mxs_auart_remove(struct platform_device *pdev)
17611764
uart_remove_one_port(&auart_driver, &s->port);
17621765
auart_port[pdev->id] = NULL;
17631766
mxs_auart_free_gpio_irq(s);
1767+
iounmap(s->port.membase);
17641768
if (is_asm9260_auart(s)) {
17651769
clk_disable_unprepare(s->clk);
17661770
clk_disable_unprepare(s->clk_ahb);

0 commit comments

Comments
 (0)