Skip to content

Commit 3836707

Browse files
eunovmmchehab
authored andcommitted
media: tegra-cec: Handle errors of clk_prepare_enable()
tegra_cec_probe() and tegra_cec_resume() ignored possible errors of clk_prepare_enable(). The patch fixes this. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Evgeny Novikov <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent c8b2639 commit 3836707

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

drivers/media/cec/platform/tegra/tegra_cec.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,11 @@ static int tegra_cec_probe(struct platform_device *pdev)
366366
return -ENOENT;
367367
}
368368

369-
clk_prepare_enable(cec->clk);
369+
ret = clk_prepare_enable(cec->clk);
370+
if (ret) {
371+
dev_err(&pdev->dev, "Unable to prepare clock for CEC\n");
372+
return ret;
373+
}
370374

371375
/* set context info. */
372376
cec->dev = &pdev->dev;
@@ -446,9 +450,7 @@ static int tegra_cec_resume(struct platform_device *pdev)
446450

447451
dev_notice(&pdev->dev, "Resuming\n");
448452

449-
clk_prepare_enable(cec->clk);
450-
451-
return 0;
453+
return clk_prepare_enable(cec->clk);
452454
}
453455
#endif
454456

0 commit comments

Comments
 (0)