commit | d230cc783aa13de5c563adec54641bec6a355054 | [log] [tgz] |
---|---|---|
author | Igor Murashkin <iam@google.com> | Tue Oct 09 14:45:37 2012 -0700 |
committer | Igor Murashkin <iam@google.com> | Tue Oct 09 14:45:37 2012 -0700 |
tree | b303e828a6ad3dd161629477e94335106fe2d34e | |
parent | 9436ff8d852306fb1160170b1cb8613d840df637 [diff] |
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
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 @@ if (res != OK) { ALOGE("%s: Camera %d: unable to initialize device: %s (%d)", __FUNCTION__, mCameraId, strerror(-res), res); + mHardware.clear(); return NO_INIT; }