Skip to content

Commit

Permalink
mutex lock access to outbufs_list in vidioc_dqbuf
Browse files Browse the repository at this point in the history
  • Loading branch information
mzihlmann committed Apr 4, 2023
1 parent fb410fc commit d927724
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions v4l2loopback.c
Original file line number Diff line number Diff line change
Expand Up @@ -1640,9 +1640,11 @@ static int vidioc_dqbuf(struct file *file, void *fh, struct v4l2_buffer *buf)
*buf = dev->buffers[index].buffer;
return 0;
case V4L2_BUF_TYPE_VIDEO_OUTPUT:
spin_lock_bh(&dev->lock);
b = list_entry(dev->outbufs_list.prev, struct v4l2l_buffer,
list_head);
list_move_tail(&b->list_head, &dev->outbufs_list);
spin_unlock_bh(&dev->lock);
dprintkrw("output DQBUF index: %d\n", b->buffer.index);
unset_flags(b);
*buf = b->buffer;
Expand Down

0 comments on commit d927724

Please sign in to comment.