projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1ea0233
)
clk: requests: Dereference the request pointer after the check
author
Maxime Ripard
<maxime@cerno.tech>
Thu, 22 Apr 2021 08:45:37 +0000
(10:45 +0200)
committer
Phil Elwell
<8911409+pelwell@users.noreply.github.com>
Thu, 22 Apr 2021 10:07:05 +0000
(11:07 +0100)
The current code will first dereference the req pointer and then test if
it's NULL, resulting in a NULL pointer dereference if req is indeed
NULL. Reorder the test and derefence to avoid the issue
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
drivers/clk/clk.c
patch
|
blob
|
history
diff --git
a/drivers/clk/clk.c
b/drivers/clk/clk.c
index
af0f638
..
1b9a76c
100644
(file)
--- a/
drivers/clk/clk.c
+++ b/
drivers/clk/clk.c
@@
-2496,10
+2496,11
@@
EXPORT_SYMBOL_GPL(clk_request_start);
*/
void clk_request_done(struct clk_request *req)
{
- struct clk_core *core
= req->clk->core
;
+ struct clk_core *core;
if (!req)
return;
+ core = req->clk->core;
clk_prepare_lock();