diff options
author | Igor Murashkin <iam@google.com> | 2012-10-09 14:45:37 -0700 |
---|---|---|
committer | Igor Murashkin <iam@google.com> | 2012-10-09 14:45:37 -0700 |
commit | 44f120fa169cb3131ec853c638ea9c88a9b33b97 (patch) | |
tree | b3eb3d0ef6d5eb1b04687aab10fc99c7ae9bb111 /services/camera | |
parent | 3d84d38e7ac02b47d17f4bb272f18f8b0e873104 (diff) | |
download | frameworks_av-44f120fa169cb3131ec853c638ea9c88a9b33b97.zip frameworks_av-44f120fa169cb3131ec853c638ea9c88a9b33b97.tar.gz frameworks_av-44f120fa169cb3131ec853c638ea9c88a9b33b97.tar.bz2 |
Camera: Clear Hardware device pointer when initialization fails
When disconnecting, don't try to call device functions if the initialization
fails since this can lead to internal HAL segfaults.
Bug: 7317107
Change-Id: Ib65db7eb6556ee10d844959934b1bfd7bb08d0ff
Diffstat (limited to 'services/camera')
-rw-r--r-- | services/camera/libcameraservice/CameraClient.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/services/camera/libcameraservice/CameraClient.cpp b/services/camera/libcameraservice/CameraClient.cpp index 5b59ef9..7e199fa 100644 --- a/services/camera/libcameraservice/CameraClient.cpp +++ b/services/camera/libcameraservice/CameraClient.cpp @@ -73,6 +73,7 @@ status_t CameraClient::initialize(camera_module_t *module) { if (res != OK) { ALOGE("%s: Camera %d: unable to initialize device: %s (%d)", __FUNCTION__, mCameraId, strerror(-res), res); + mHardware.clear(); return NO_INIT; } |