lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220919085455.1582310-1-floridsleeves@gmail.com>
Date:   Mon, 19 Sep 2022 01:54:55 -0700
From:   Li Zhong <floridsleeves@...il.com>
To:     linux-kernel@...r.kernel.org, linux-mediatek@...ts.infradead.org,
        linux-arm-kernel@...ts.infradead.org, linux-serial@...r.kernel.org
Cc:     etremblay@...tech-controls.com, l.sanfilippo@...bus.com,
        u.kleine-koenig@...gutronix.de, robert.hancock@...ian.com,
        ilpo.jarvinen@...ux.intel.com, matthias.bgg@...il.com,
        p.zabel@...gutronix.de, jirislaby@...nel.org,
        Li Zhong <floridsleeves@...il.com>
Subject: [PATCH v1] drivers/tty/serial/8250: check the return value of clk_prepare_enable()

Check the return value of clk_prepare_enable() which could fail when
cannot enable the clock.

Signed-off-by: Li Zhong <floridsleeves@...il.com>
---
 drivers/tty/serial/8250/8250_of.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/8250/8250_of.c b/drivers/tty/serial/8250/8250_of.c
index 1b461fba15a3..23e9b9e8c940 100644
--- a/drivers/tty/serial/8250/8250_of.c
+++ b/drivers/tty/serial/8250/8250_of.c
@@ -298,7 +298,8 @@ static int of_serial_resume(struct device *dev)
 
 	if (!uart_console(port) || console_suspend_enabled) {
 		pm_runtime_get_sync(dev);
-		clk_prepare_enable(info->clk);
+		if (clk_prepare_enable(info->clk) < 0)
+			dev_warn(dev, "can't enable clk.\n");
 	}
 
 	serial8250_resume_port(info->line);
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ