mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-10-02 09:30:43 +09:00
video: ipu: Fix dereferencing NULL pointer problem
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>
This commit is contained in:
parent
1314bd1192
commit
cca3ff054a
@ -132,8 +132,12 @@ struct clk *clk_get_parent(struct clk *clk)
|
|||||||
|
|
||||||
int clk_set_rate(struct clk *clk, unsigned long rate)
|
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);
|
clk->set_rate(clk, rate);
|
||||||
|
|
||||||
return clk->rate;
|
return clk->rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user