Skip to content

Commit

Permalink
media: tegra-cec: Handle errors of clk_prepare_enable()
Browse files Browse the repository at this point in the history
[ Upstream commit 3836707 ]

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 <novikov@ispras.ru>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
eunovm authored and gregkh committed Sep 18, 2021
1 parent c0c963a commit 146a282
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/media/cec/platform/tegra/tegra_cec.c
Expand Up @@ -366,7 +366,11 @@ static int tegra_cec_probe(struct platform_device *pdev)
return -ENOENT;
}

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

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

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

clk_prepare_enable(cec->clk);

return 0;
return clk_prepare_enable(cec->clk);
}
#endif

Expand Down

0 comments on commit 146a282

Please sign in to comment.