From 12053cf8e6a98104b6c765e1ac8a34b8f7a02eed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Sun, 14 Apr 2019 00:28:53 +0200 Subject: libcamera: Always check return value of MediaDevice::acquire() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In preparation for adding more responsibility to MediaDevice::acquire() remove unneeded calls to acquire() and release(), and make sure all needed calls to acquire() are checked and acted on. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- test/media_device/media_device_link_test.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test/media_device') diff --git a/test/media_device/media_device_link_test.cpp b/test/media_device/media_device_link_test.cpp index 58a55cdf..484d3691 100644 --- a/test/media_device/media_device_link_test.cpp +++ b/test/media_device/media_device_link_test.cpp @@ -51,7 +51,11 @@ class MediaDeviceLinkTest : public Test return TestSkip; } - dev_->acquire(); + if (!dev_->acquire()) { + cerr << "Unable to acquire media device " + << dev_->deviceNode() << endl; + return TestSkip; + } if (dev_->open()) { cerr << "Failed to open media device at " -- cgit v1.2.1