summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPreetam Singh Ranawat <apranawat@codeaurora.org>2019-06-24 15:11:28 +0530
committerKevin F. Haggerty <haggertk@lineageos.org>2020-01-25 09:28:58 -0700
commited564ae329c0a5bdb768aeb85f6785d8953a5f56 (patch)
tree99c511f13fc4d30d5bb6871d51a0f7ca1ccce040
parent8b312302586b18f6cf1f37afa0fa6b3c19bb46b9 (diff)
downloadhardware_qcom_audio-cm-14.1-caf-8974.tar.gz
hardware_qcom_audio-cm-14.1-caf-8974.tar.bz2
hardware_qcom_audio-cm-14.1-caf-8974.zip
audio: free and assign NULL to global static device pointercm-14.1-caf-8974
-free and assign NULL to global static device pointer instead of local pointer to avoid free after use issue. Change-Id: Idfdef719320efcd792c7d2ebd7ec2dfe5d3fbfbd
-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 c82ba349..d69462a1 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -3657,9 +3657,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);