From: Fabio Estevam Date: Fri, 9 Sep 2016 11:31:33 +0000 (-0300) Subject: serial: mxs-auart: Disable clock on error path X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5d7519dfc963;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git serial: mxs-auart: Disable clock on error path We should disable the previously acquired clock when enabling s->clk fails. Signed-off-by: Fabio Estevam Reviewed-by: Uwe Kleine-König Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c index 2f04ec2b5691..680270b85ff7 100644 --- a/drivers/tty/serial/mxs-auart.c +++ b/drivers/tty/serial/mxs-auart.c @@ -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; } /*