summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorIgor Murashkin <iam@google.com>2012-10-09 14:45:37 -0700
committerIgor Murashkin <iam@google.com>2012-10-09 14:45:37 -0700
commitd230cc783aa13de5c563adec54641bec6a355054 (patch)
treeb303e828a6ad3dd161629477e94335106fe2d34e /services
parent9436ff8d852306fb1160170b1cb8613d840df637 (diff)
downloadframeworks_av-d230cc783aa13de5c563adec54641bec6a355054.zip
frameworks_av-d230cc783aa13de5c563adec54641bec6a355054.tar.gz
frameworks_av-d230cc783aa13de5c563adec54641bec6a355054.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')
-rw-r--r--services/camera/libcameraservice/CameraClient.cpp1
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;
}