diff options
author | Naushir Patuck <naush@raspberrypi.com> | 2022-10-28 14:38:47 +0100 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2022-10-28 15:27:23 +0100 |
commit | a2bdff6d0b67475492ac7cf9318866b6d89a28fd (patch) | |
tree | 8710f78bcdeb4eed6614028da73cb274a802ffbc /src/apps/cam/capture_script.cpp | |
parent | 02518e598e8f057b76a08940e1bc8a99d879fad6 (diff) |
libcamera: v4l2_videodevice: Guard against releasing unallocated buffers
releaseBuffers() unconditionally calls ioctl(REQBUFS, 0) to release device
buffer allocations through the close() and class destructor functions. If
another libcamera process is running concurrently with a different sensor, it
would cause the ioctl to fail in the kernel because the buffer queue is owned
owned by the other process. This in turn would cause libcamera to generate an
error log message.
Fix this by ensuring the releaseBuffers() only calls ioctl(REQBUFS, 0) if there
have been buffers previously allocated by the device. This is done by testing
the presense of the V4L2BufferCache in the object.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/apps/cam/capture_script.cpp')
0 files changed, 0 insertions, 0 deletions