diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-09-08 10:48:46 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-09-16 14:21:28 +0300 |
commit | de20029a582a71a87d99388a62fb63c86e85028a (patch) | |
tree | 9bffafeabdb1104444550094fa7cdab06a0f0405 /test/controls/meson.build | |
parent | 219cbfe76b5a7d9d8206c71aa6115ff8befcff9b (diff) |
android: Protect against null callbacks
According to the Android camera HAL C interface documentation, the
camera service is supposed to set callbacks after initializing the HAL
and calling get_number_of_cameras(), before any other calls to the
module. We rely on this behaviour and use callbacks unconditionally,
which would lead to a crash if the camera service behaved incorrectly.
While the camera service isn't supposed to behave incorrectly,
gracefully handling the error when opening cameras isn't costly, and
provides better diagnostic than a crash.
While at it, removed an unneeded [[maybe_unused]] attribute.
Reported-by: Coverity CID=298638
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Umang Jain <email@uajain.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'test/controls/meson.build')
0 files changed, 0 insertions, 0 deletions