Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e15afa67 authored by Evgeny Novikov's avatar Evgeny Novikov Committed by Greg Kroah-Hartman
Browse files

media: tegra-cec: Handle errors of clk_prepare_enable()



[ Upstream commit 38367073c796a37a61549b1f66a71b3adb03802d ]

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: default avatarEvgeny Novikov <novikov@ispras.ru>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 53d02b04
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -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;
@@ -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