]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
serial: 8250_dw: Disable clock on error
authorStefan Potyra <Stefan.Potyra@elektrobit.com>
Wed, 6 Dec 2017 15:46:12 +0000 (16:46 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 24 Mar 2018 10:02:46 +0000 (11:02 +0100)
[ Upstream commit 8af016aa5a27c6a2505460eb4d83f1e70c38dc43 ]

If there is no clock rate for uartclk defined, disable the previously
enabled clock again.

Found by Linux Driver Verification project (linuxtesting.org).

Fixes: 23f5b3fdd04e serial: 8250_dw: only get the clock rate in one place
Signed-off-by: Stefan Potyra <Stefan.Potyra@elektrobit.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_dw.c

index 7070203e3157872d3c444b83e1293dd06671aaf4..cd1b94a0f451ca2d033dcf51ee55ce39be274ee6 100644 (file)
@@ -509,7 +509,8 @@ static int dw8250_probe(struct platform_device *pdev)
        /* If no clock rate is defined, fail. */
        if (!p->uartclk) {
                dev_err(dev, "clock rate not defined\n");
-               return -EINVAL;
+               err = -EINVAL;
+               goto err_clk;
        }
 
        data->pclk = devm_clk_get(dev, "apb_pclk");