summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@linaro.org>2024-10-23 10:30:55 +0200
committerHans Verkuil <hverkuil@xs4all.nl>2024-11-07 09:05:57 +0100
commit8e9a03bd410d659e9ebb6a27ce2d032c7014c68b (patch)
tree6776bbb1c27437d707b2b38b90ae18521f93ea28 /drivers/media/platform
parentmedia: v4l2-subdev: Refactor events (diff)
downloadlinux-8e9a03bd410d659e9ebb6a27ce2d032c7014c68b.tar.xz
linux-8e9a03bd410d659e9ebb6a27ce2d032c7014c68b.zip
media: raspberrypi: Do some cleanup in probe()
If devm_clk_get() fails then we need to free "cfe" before returning. Fixes: 6edb685abb2a ("media: raspberrypi: Add support for RP1-CFE") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r--drivers/media/platform/raspberrypi/rp1-cfe/cfe.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/media/platform/raspberrypi/rp1-cfe/cfe.c b/drivers/media/platform/raspberrypi/rp1-cfe/cfe.c
index ac28089564b2..4800d9a2668a 100644
--- a/drivers/media/platform/raspberrypi/rp1-cfe/cfe.c
+++ b/drivers/media/platform/raspberrypi/rp1-cfe/cfe.c
@@ -2342,9 +2342,11 @@ static int cfe_probe(struct platform_device *pdev)
/* TODO: Enable clock only when running. */
cfe->clk = devm_clk_get(&pdev->dev, NULL);
- if (IS_ERR(cfe->clk))
- return dev_err_probe(&pdev->dev, PTR_ERR(cfe->clk),
- "clock not found\n");
+ if (IS_ERR(cfe->clk)) {
+ ret = dev_err_probe(&pdev->dev, PTR_ERR(cfe->clk),
+ "clock not found\n");
+ goto err_cfe_put;
+ }
cfe->mdev.dev = &pdev->dev;
cfe->mdev.ops = &cfe_media_device_ops;