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

Commit 3cde8922 authored by Anish Kumar's avatar Anish Kumar
Browse files

hal: check the pointer before dereference

thermal_client_unregister_callback pointer should be checked
for NULL before it is dereferenced.

Change-Id: I3b3a46c93c445a723a7db8a64c727c08f6ca5caf
parent 1b390418
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -746,7 +746,8 @@ void audio_extn_spkr_prot_init(void *adev)
        (const pthread_attr_t *) NULL, spkr_calibration_thread, &handle);
    } else {
        ALOGE("%s: thermal_client_request failed", __func__);
        if (handle.thermal_client_handle)
        if (handle.thermal_client_handle &&
            handle.thermal_client_unregister_callback)
            handle.thermal_client_unregister_callback(handle.thermal_client_handle);
        if (handle.thermal_handle)
            dlclose(handle.thermal_handle);