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

Commit b18577ff authored by Preetam Singh Ranawat's avatar Preetam Singh Ranawat Committed by Han Wang
Browse files

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 free after use issue.

Change-Id: Idfdef719320efcd792c7d2ebd7ec2dfe5d3fbfbd
(cherry picked from commit 837e3080)
parent c382d19d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3300,9 +3300,9 @@ static int adev_dump(const audio_hw_device_t *device __unused,

static int adev_close(hw_device_t *device)
{
    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);