libcamera: camera: Ensure queued requests are invalid
Invalid, or not correctly reset requests can cause undefined behaviour in the pipeline handlers due to unexpected request state. If the status has not been reset to Request::RequestPending, it is either not new, or has not been correctly procesed through Request::reuse(). This can be caught early by validating the status of the request when it is queued to a camera. Reject invalid requests before processing them in the pipeline handlers. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
d9371444c4
commit
e39f046f66
1 changed files with 5 additions and 0 deletions
|
@ -1126,6 +1126,11 @@ int Camera::queueRequest(Request *request)
|
|||
return -EXDEV;
|
||||
}
|
||||
|
||||
if (request->status() != Request::RequestPending) {
|
||||
LOG(Camera, Error) << request->toString() << " is not valid";
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/*
|
||||
* The camera state may change until the end of the function. No locking
|
||||
* is however needed as PipelineHandler::queueRequest() will handle
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue