Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d230cc78 authored by Igor Murashkin's avatar Igor Murashkin
Browse files

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
parent 9436ff8d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;
    }