From: Jonathan Bakker Date: Thu, 30 Jul 2020 23:01:13 +0000 (+0200) Subject: media: exynos4-is: Handle duplicate calls to vidioc_streamoff X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e571f75b6b907dccc285c0e03f02fa261e79d981;p=linux.git 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 Reviewed-by: Sylwester Nawrocki Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/exynos4-is/fimc-capture.c b/drivers/media/platform/exynos4-is/fimc-capture.c index 464a6174b77d5..6000a4e789adb 100644 --- a/drivers/media/platform/exynos4-is/fimc-capture.c +++ b/drivers/media/platform/exynos4-is/fimc-capture.c @@ -1235,8 +1235,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; }