[libcamera-devel] [PATCH 1/5] libcamera: camera: Fix access bug in configureStreams()

Niklas Söderlund niklas.soderlund at ragnatech.se
Sun Mar 10 23:28:43 CET 2019


Hi Laurent,

Thanks for your feedback.

On 2019-03-10 15:16:07 +0200, Laurent Pinchart wrote:
> Hi Niklas,
> 
> Thank you for the patch.
> 
> On Wed, Mar 06, 2019 at 03:47:51AM +0100, Niklas Söderlund wrote:
> > 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 <niklas.soderlund at ragnatech.se>
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

As this patch is a bug fix and not strictly related to the addition of 
the camera tests the rest of this series deals with I have pushed this 
fix with your tag, thanks!

> 
> > ---
> >  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<Stream *, StreamConfiguration> &config)
> >  	if (disconnected_)
> >  		return -ENODEV;
> >  
> > -	if (!stateBetween(CameraAvailable, CameraConfigured))
> > +	if (!stateBetween(CameraAcquired, CameraConfigured))
> >  		return -EACCES;
> >  
> >  	if (!config.size()) {
> 
> -- 
> Regards,
> 
> Laurent Pinchart

-- 
Regards,
Niklas Söderlund


More information about the libcamera-devel mailing list