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:
de20632
)
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
Dom Cobley
<popcornmix@gmail.com>
Mon, 21 Mar 2022 16:04:14 +0000
(16:04 +0000)
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
cdb6c37
..
33de2b7
100644
(file)
--- a/
drivers/clk/clk.c
+++ b/
drivers/clk/clk.c
@@
-2515,10
+2515,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();