summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarter Hsu <carterhsu@google.com>2019-10-21 09:58:17 +0800
committerHarrison Lingren <hlingren@google.com>2019-11-15 21:02:29 +0000
commit73d6b59977595c1d0a222a1656f298e7991e43b9 (patch)
tree56cb73a9204bdf3bd3019b7d5d0eb43ea89f6ce6
parentd9ec40cbfe00cdf6b77eb6deb8cde14f93b8beac (diff)
downloadandroid_hardware_qcom_audio-73d6b59977595c1d0a222a1656f298e7991e43b9.tar.gz
android_hardware_qcom_audio-73d6b59977595c1d0a222a1656f298e7991e43b9.tar.bz2
android_hardware_qcom_audio-73d6b59977595c1d0a222a1656f298e7991e43b9.zip
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
-rw-r--r--hal/audio_hw.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 58d8f856..1c99066f 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -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);