projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1314bd1
)
video: ipu: Fix dereferencing NULL pointer problem
author
Peng Fan
<peng.fan@nxp.com>
Tue, 2 Jan 2018 07:25:36 +0000
(15:25 +0800)
committer
Anatolij Gustschin
<agust@denx.de>
Wed, 3 Jan 2018 08:46:52 +0000
(09:46 +0100)
The clk_set_rate function dereferences the clk pointer without
checking whether it is NULL. This may cause problem when clk is NULL.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
drivers/video/ipu_common.c
patch
|
blob
|
history
diff --git
a/drivers/video/ipu_common.c
b/drivers/video/ipu_common.c
index 96229da502bc13998721ccef733e4d93021b8302..889085aa767e2fee4ac7b483d6f9b7cfc0b20423 100644
(file)
--- a/
drivers/video/ipu_common.c
+++ b/
drivers/video/ipu_common.c
@@
-132,8
+132,12
@@
struct clk *clk_get_parent(struct clk *clk)
int clk_set_rate(struct clk *clk, unsigned long rate)
{
- if (clk && clk->set_rate)
+ if (!clk)
+ return 0;
+
+ if (clk->set_rate)
clk->set_rate(clk, rate);
+
return clk->rate;
}