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]
Message-Id: <20170718101730.2541-4-jonas.gorski@gmail.com>
Date:   Tue, 18 Jul 2017 12:17:24 +0200
From:   Jonas Gorski <jonas.gorski@...il.com>
To:     unlisted-recipients:; (no To-header on input)
Cc:     Steven Miao <realmz6@...il.com>,
        Masahiro Yamada <yamada.masahiro@...ionext.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        adi-buildroot-devel@...ts.sourceforge.net,
        linux-kernel@...r.kernel.org
Subject: [PATCH 3/9] blackfin: bf609: allow NULL clock for clk_get_rate

Make the behaviour of clk_get_rate consistent with common clk's
clk_get_rate by accepting NULL clocks as parameter. Some device
drivers rely on this, and will cause an OOPS otherwise.

Fixes: 969003152aa9 ("blackfin: bf60x: add clock support")
Cc: Steven Miao <realmz6@...il.com>
Cc: Masahiro Yamada <yamada.masahiro@...ionext.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: adi-buildroot-devel@...ts.sourceforge.net
Cc: linux-kernel@...r.kernel.org
Reported-by: Mathias Kresin <dev@...sin.me>
Signed-off-by: Jonas Gorski <jonas.gorski@...il.com>
---
 arch/blackfin/mach-bf609/clock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/blackfin/mach-bf609/clock.c b/arch/blackfin/mach-bf609/clock.c
index 392a59b9a504..21a0ec18829f 100644
--- a/arch/blackfin/mach-bf609/clock.c
+++ b/arch/blackfin/mach-bf609/clock.c
@@ -109,7 +109,7 @@ EXPORT_SYMBOL(clk_disable);
 unsigned long clk_get_rate(struct clk *clk)
 {
 	unsigned long ret = 0;
-	if (clk->ops && clk->ops->get_rate)
+	if (clk && clk->ops && clk->ops->get_rate)
 		ret = clk->ops->get_rate(clk);
 	return ret;
 }
-- 
2.11.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ