From f69c3c1caecb4f18a6e39aa93522c86bc1e4c4af Mon Sep 17 00:00:00 2001 From: Shubhrajyoti Datta Date: Tue, 24 Nov 2020 15:05:16 +0530 Subject: [PATCH] serial-uartlite: Add the check for clk_enable Add a check for clk_enable. Addresses-Coverity: Event check_return. Signed-off-by: Shubhrajyoti Datta --- drivers/tty/serial/uartlite.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c index e19013d50d32..c8c496b32d38 100644 --- a/drivers/tty/serial/uartlite.c +++ b/drivers/tty/serial/uartlite.c @@ -722,8 +722,13 @@ static int __maybe_unused ulite_runtime_resume(struct device *dev) { struct uart_port *port = dev_get_drvdata(dev); struct uartlite_data *pdata = port->private_data; + int ret; - clk_enable(pdata->clk); + ret = clk_enable(pdata->clk); + if (ret) { + dev_err(dev, "Cannot enable clock.\n"); + return ret; + } return 0; } /* --------------------------------------------------------------------- -- GitLab