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-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 20 Sep 2022 18:31:00 +0800
From:   Jianqun Xu <jay.xu@...k-chips.com>
To:     linus.walleij@...aro.org, heiko@...ech.de, brgl@...ev.pl,
        andriy.shevchenko@...ux.intel.com
Cc:     robert.moore@...el.com, robh@...nel.org,
        linux-rockchip@...ts.infradead.org, linux-kernel@...r.kernel.org,
        lenb@...nel.org, rafael@...nel.org,
        Jianqun Xu <jay.xu@...k-chips.com>
Subject: [PATCH 12/20] gpio/rockchip: add return check for clock rate set

Check if the clock rate set for the apb clock is successful or not.

Signed-off-by: Jianqun Xu <jay.xu@...k-chips.com>
---
 drivers/gpio/gpio-rockchip.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpio/gpio-rockchip.c b/drivers/gpio/gpio-rockchip.c
index e36cdbd4bbef..511e93a6a429 100644
--- a/drivers/gpio/gpio-rockchip.c
+++ b/drivers/gpio/gpio-rockchip.c
@@ -199,6 +199,9 @@ static int rockchip_gpio_set_debounce(struct gpio_chip *gc,
 	if (bank->gpio_type == GPIO_TYPE_V2 && !IS_ERR(bank->db_clk)) {
 		div_debounce_support = true;
 		freq = clk_get_rate(bank->db_clk);
+		if (!freq)
+			return -EINVAL;
+
 		max_debounce = (GENMASK(23, 0) + 1) * 2 * 1000000 / freq;
 		if (debounce > max_debounce)
 			return -EINVAL;
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ