[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <BN6PR04MB06606A36716392E7634CF8DCA3710@BN6PR04MB0660.namprd04.prod.outlook.com>
Date: Thu, 30 Jul 2020 16:01:13 -0700
From: Jonathan Bakker <xc-racer2@...e.ca>
To: kyungmin.park@...sung.com, s.nawrocki@...sung.com,
mchehab@...nel.org, kgene@...nel.org, krzk@...nel.org,
linux-media@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-samsung-soc@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: devicetree@...r.kernel.org, robh+dt@...nel.org,
Jonathan Bakker <xc-racer2@...e.ca>
Subject: [PATCH v2 10/11] media: exynos4-is: Handle duplicate calls to vidioc_streamoff
vidioc_streamoff can be called multiple times from userspace, but we
should only call media_pipeline_stop when we're actually setup.
This became more noticeable after commit 2a2599c66368 ("[media] media:
entity: Catch unbalanced media_pipeline_stop calls") was merged as it
added a WARN for unbalanced calls to media_pipeline_stop.
Signed-off-by: Jonathan Bakker <xc-racer2@...e.ca>
---
Changes from v1:
- re-worded commit message for a better description of the problem
---
drivers/media/platform/exynos4-is/fimc-capture.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/media/platform/exynos4-is/fimc-capture.c b/drivers/media/platform/exynos4-is/fimc-capture.c
index e70785d8a809..887a736b2e0e 100644
--- a/drivers/media/platform/exynos4-is/fimc-capture.c
+++ b/drivers/media/platform/exynos4-is/fimc-capture.c
@@ -1232,8 +1232,11 @@ static int fimc_cap_streamoff(struct file *file, void *priv,
if (ret < 0)
return ret;
- media_pipeline_stop(&vc->ve.vdev.entity);
- vc->streaming = false;
+ if (vc->streaming) {
+ media_pipeline_stop(&vc->ve.vdev.entity);
+ vc->streaming = false;
+ }
+
return 0;
}
--
2.20.1
Powered by blists - more mailing lists