aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2024-10-13 17:40:53 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2024-11-07 15:16:06 +0100
commit751d13a0cffb5c0420bcf8bbd7bd613f2a359d89 (patch)
tree0af96520dfe40dd0038e33548b2a5443927431eb
parentmedia: atomisp: Remove unused libmsrlisthelper (diff)
downloadwireguard-linux-751d13a0cffb5c0420bcf8bbd7bd613f2a359d89.tar.xz
wireguard-linux-751d13a0cffb5c0420bcf8bbd7bd613f2a359d89.zip
media: atomisp: Fix WARN_ON() in vb2_start_streaming() triggering
If atomisp fails to start the stream the buffers must be returned to the VB2_BUF_STATE_QUEUED state before returning an error from atomisp_start_streaming(). This fixes the following WARN_ON(): [ 250.313554] WARNING: CPU: 3 PID: 2178 at drivers/media/common/videobuf2/videobuf2-core.c:1801 vb2_start_streaming+0xcb/0x150 [videobuf2_common] Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy@kernel.org> Link: https://lore.kernel.org/r/20241013154056.12532-2-hdegoede@redhat.com Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to '')
-rw-r--r--drivers/staging/media/atomisp/pci/atomisp_ioctl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
index d7e8a9871522..47d8a17379b0 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
@@ -881,8 +881,10 @@ int atomisp_start_streaming(struct vb2_queue *vq, unsigned int count)
mutex_lock(&isp->mutex);
ret = atomisp_pipe_check(pipe, false);
- if (ret)
+ if (ret) {
+ atomisp_flush_video_pipe(pipe, VB2_BUF_STATE_QUEUED, true);
goto out_unlock;
+ }
/*
* When running a classic v4l2 app after a media-controller aware
@@ -895,6 +897,7 @@ int atomisp_start_streaming(struct vb2_queue *vq, unsigned int count)
mutex_unlock(&isp->media_dev.graph_mutex);
if (ret) {
dev_err(isp->dev, "Error starting mc pipeline: %d\n", ret);
+ atomisp_flush_video_pipe(pipe, VB2_BUF_STATE_QUEUED, true);
goto out_unlock;
}