staging: media: ipu3: Return buffers outside of needless locking
authorMax Staudt <mstaudt@chromium.org>
Thu, 20 Jun 2024 14:45:42 +0000 (23:45 +0900)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Sat, 31 Aug 2024 07:40:42 +0000 (09:40 +0200)
In imgu_vb2_start_streaming()'s error path, imgu_return_all_buffers()
is outside the streaming_lock and after the call to
video_device_pipeline_stop().

Let's apply the same order in imgu_vb2_stop_streaming() as well.

Signed-off-by: Max Staudt <mstaudt@chromium.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/staging/media/ipu3/ipu3-v4l2.c

index 541556037c422f3fed6d21a666c0c4685de08228..3ff390b04e1ab83049a3d517f856bebe4d905c0a 100644 (file)
@@ -556,10 +556,10 @@ static void imgu_vb2_stop_streaming(struct vb2_queue *vq)
                        imgu->streaming = false;
        }
 
-       imgu_return_all_buffers(imgu, node, VB2_BUF_STATE_ERROR);
        mutex_unlock(&imgu->streaming_lock);
 
        video_device_pipeline_stop(&node->vdev);
+       imgu_return_all_buffers(imgu, node, VB2_BUF_STATE_ERROR);
 }
 
 /******************** v4l2_ioctl_ops ********************/