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

Commit a0caa814 authored by Carter Hsu's avatar Carter Hsu Committed by android-build-team Robot
Browse files

audio: free and assign NULL to global static device pointer

From: Preetam Singh Ranawat <apranawat@codeaurora.org>
Date: Mon, 24 Jun 2019 15:11:28 +0530
Subject: audio: free and assign NULL to global static device pointer

 -free and assign NULL to global static device pointer instead of local
  pointer to avoid use after free issue.

Bug: 142267478
Test: manual
Change-Id: I6f64fe0f6034844279c9a481726426dc5b989b41
(cherry picked from commit 73d6b599)
parent 2ea16ffc
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -6282,9 +6282,9 @@ static int adev_verify_devices(struct audio_device *adev)
static int adev_close(hw_device_t *device)
{
    size_t i;
    struct audio_device *adev = (struct audio_device *)device;
    struct audio_device *adev_temp = (struct audio_device *)device;

    if (!adev)
    if (!adev_temp)
        return 0;

    pthread_mutex_lock(&adev_init_lock);