From patchwork Wed Mar 6 02:47:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 705 Return-Path: Received: from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net [195.74.38.229]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id CA1A9611A8 for ; Wed, 6 Mar 2019 03:48:17 +0100 (CET) X-Halon-ID: 4979d1b6-3fba-11e9-985a-005056917f90 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (unknown [89.233.230.99]) by bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA id 4979d1b6-3fba-11e9-985a-005056917f90; Wed, 06 Mar 2019 03:48:16 +0100 (CET) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Wed, 6 Mar 2019 03:47:51 +0100 Message-Id: <20190306024755.28726-2-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190306024755.28726-1-niklas.soderlund@ragnatech.se> References: <20190306024755.28726-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/5] libcamera: camera: Fix access bug in configureStreams() X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Mar 2019 02:48:18 -0000 It is not permitted to configure streams before a camera is acquired. Fixes: 77100a7578d8a0cc ("libcamera: camera: add state machine to control access from applications") Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- src/libcamera/camera.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp index e3144c5b4ab093b2..8ee9cc0866167ae1 100644 --- a/src/libcamera/camera.cpp +++ b/src/libcamera/camera.cpp @@ -405,7 +405,7 @@ int Camera::configureStreams(std::map &config) if (disconnected_) return -ENODEV; - if (!stateBetween(CameraAvailable, CameraConfigured)) + if (!stateBetween(CameraAcquired, CameraConfigured)) return -EACCES; if (!config.size()) {