media: marvell: Added function return value check clk_prepare
Subsystems (2)
PATCH 1/1 media: marvell: Added function return value check clk_prepare
Return value of function 'clk_prepare', called at mcam-core.c:905, is not checked, but it is usually checked for this function.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by Denis Arefev <[email protected]>
--- drivers/media/platform/marvell/mcam-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/media/platform/marvell/mcam-core.c +4 -3
@@ -901,9 +901,10 @@ static void mcam_ctlr_power_down(struct mcam_camera *cam)static int mclk_prepare (struct clk_hw *hw) { struct mcam_camera *cam = container_of(hw, struct mcam_camera, mclk_hw); - -clk_prepare (cam->clk[0 ]); -return 0 ; +int ret; + + ret =clk_prepare (cam->clk[0 ]); +return ret; }static void mclk_unprepare (struct clk_hw *hw)
Signature · 1 line
2.25.1
Dear Denis,
Quoted 2 lines · Denis Arefev
Return value of function '
clk_prepare', called at mcam-core.c:905, is not checked, but it is usually checked for this function.
Something is wrong with the indents in the commit message.
Quoted 13 lines
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by Denis Arefev <[email protected]>--- drivers/media/platform/marvell/mcam-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/media/platform/marvell/mcam-core.c +0
-0
drivers/media/platform/marvell/mcam-core.c static void mcam_ctlr_power_down(struct mcam_camera *cam) · line 907
Quoted 10 lines
drivers/media/platform/marvell/mcam-core.c +4
-3@@ -901,9 +901,10 @@ static void mcam_ctlr_power_down(struct mcam_camera *cam)static int mclk_prepare (struct clk_hw *hw) { struct mcam_camera *cam = container_of(hw, struct mcam_camera, mclk_hw); - -clk_prepare (cam->clk[0 ]); -return 0 ; +int ret; + + ret =clk_prepare (cam->clk[0 ]); +return ret;
Why do we need to introduce an intermediate variable?
--
Alexey