diff options
author | Ye.Li <B37916@freescale.com> | 2015-12-04 15:17:07 +0800 |
---|---|---|
committer | Ye Li <ye.li@nxp.com> | 2017-04-05 14:04:27 +0800 |
commit | 9345c99eb5e4dcb1b16161aa7f1876865e25006e (patch) | |
tree | 4260d9539d0ce5ce54089eb0d6610a7c88d4aa9b /drivers/video/ipu_common.c | |
parent | 036b71e1cd77ddb1827fd85eb7035fb7eccb7b12 (diff) | |
download | u-boot-imx-9345c99eb5e4dcb1b16161aa7f1876865e25006e.zip u-boot-imx-9345c99eb5e4dcb1b16161aa7f1876865e25006e.tar.gz u-boot-imx-9345c99eb5e4dcb1b16161aa7f1876865e25006e.tar.bz2 |
MLK-11952 Video: IPU: Fix dereferencing NULL pointer problem
By Coverity check, the clk_set_rate function dereferences the clk pointer
without checking whether it is NULL. This may cause problem when clk is NULL.
Fix the problem by adding NULL check.
Signed-off-by: Ye.Li <B37916@freescale.com>
(cherry picked from commit ded2f2958d568411274eeecd265fcc1181638335)
(cherry picked from commit b58ac1502391d87470918ff8d172b2b8dc1e7a68)
Diffstat (limited to 'drivers/video/ipu_common.c')
-rw-r--r-- | drivers/video/ipu_common.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/video/ipu_common.c b/drivers/video/ipu_common.c index ebe720a..28b4bcf 100644 --- a/drivers/video/ipu_common.c +++ b/drivers/video/ipu_common.c @@ -128,6 +128,10 @@ int clk_set_rate(struct clk *clk, unsigned long rate) { if (clk && clk->set_rate) clk->set_rate(clk, rate); + + if (!clk) + return 0; + return clk->rate; } |