Skip to content

Commit

Permalink
serial: mxs-auart: Disable clock on error path
Browse files Browse the repository at this point in the history
We should disable the previously acquired clock when enabling s->clk
fails.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Fabio Estevam authored and Greg Kroah-Hartman committed Sep 13, 2016
1 parent 8b2303d commit 5d7519d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/tty/serial/mxs-auart.c
Original file line number Diff line number Diff line change
Expand Up @@ -1543,10 +1543,14 @@ static int mxs_get_clks(struct mxs_auart_port *s,
err = clk_prepare_enable(s->clk);
if (err) {
dev_err(s->dev, "Failed to enable clk!\n");
return err;
goto disable_clk_ahb;
}

return 0;

disable_clk_ahb:
clk_disable_unprepare(s->clk_ahb);
return err;
}

/*
Expand Down

0 comments on commit 5d7519d

Please sign in to comment.