build/patch/kernel/archive/sunxi-6.1/patches.megous/media-cedrus-Fix-failure-to-clean-up-hardware-on-probe-failure.patch

37 lines
1.1 KiB
Diff

From 2139677576b54b09d32198d71285968430c33244 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sun, 26 Apr 2020 14:38:15 -0500
Subject: [PATCH 175/389] media: cedrus: Fix failure to clean up hardware on
probe failure
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
drivers/staging/media/sunxi/cedrus/cedrus.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c b/drivers/staging/media/sunxi/cedrus/cedrus.c
index 9d7fa19cab2c..2633a445f161 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus.c
+++ b/drivers/staging/media/sunxi/cedrus/cedrus.c
@@ -474,7 +474,7 @@ static int cedrus_probe(struct platform_device *pdev)
ret = v4l2_device_register(&pdev->dev, &dev->v4l2_dev);
if (ret) {
dev_err(&pdev->dev, "Failed to register V4L2 device\n");
- return ret;
+ goto err_hw;
}
vfd = &dev->vfd;
@@ -535,6 +535,8 @@ static int cedrus_probe(struct platform_device *pdev)
v4l2_m2m_release(dev->m2m_dev);
err_v4l2:
v4l2_device_unregister(&dev->v4l2_dev);
+err_hw:
+ cedrus_hw_remove(dev);
return ret;
}
--
2.35.3