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

37 lines
1.1 KiB
Diff

From c575bc730af77721642290f08d086c85f376f3ed Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sun, 26 Apr 2020 14:38:15 -0500
Subject: [PATCH 282/478] 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 aab12fb96a9b..9389154b4f74 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus.c
+++ b/drivers/staging/media/sunxi/cedrus/cedrus.c
@@ -391,7 +391,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;
@@ -454,6 +454,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