Skip to content

Commit

Permalink
allocate_buffers: fix check whether we can re-allocate
Browse files Browse the repository at this point in the history
Closes: #553
  • Loading branch information
IOhannes m zmölnig authored and IOhannes m zmölnig committed Mar 19, 2024
1 parent 5d72c17 commit b9a340e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions v4l2loopback.c
Original file line number Diff line number Diff line change
Expand Up @@ -2393,8 +2393,8 @@ static int allocate_buffers(struct v4l2_loopback_device *dev)
if (dev->buffer_size * dev->buffers_number == dev->imagesize)
return 0;

/* if there is only one writer, no problem should occur */
if (dev->open_count.counter == 1)
/* check whether the total number of readers/writers is <=1 */
if ((dev->ready_for_capture + dev->active_readers) <= 1)
free_buffers(dev);
else
return -EINVAL;
Expand Down

0 comments on commit b9a340e

Please sign in to comment.