summaryrefslogtreecommitdiffstats
path: root/audio_a2dp_hw
diff options
context:
space:
mode:
authorAyan Ghosh <abghosh@codeaurora.org>2015-10-16 15:47:40 +0530
committerGaurav Asati <gasati@codeaurora.org>2015-10-21 10:50:09 +0530
commit220c900a0f0a218658f6b2b771ef4cc574ba23f0 (patch)
treea80feb61b7b6f6babe831d6a3f904e445d66bc4d /audio_a2dp_hw
parent05223fd1e48776c30809ce2497033f5810168fa5 (diff)
downloadandroid_system_bt-220c900a0f0a218658f6b2b771ef4cc574ba23f0.tar.gz
android_system_bt-220c900a0f0a218658f6b2b771ef4cc574ba23f0.tar.bz2
android_system_bt-220c900a0f0a218658f6b2b771ef4cc574ba23f0.zip
Check for valid fd before closing the same.
For Audio dump debug feature, dump file's validity is not checked before closing the same. This leads to crash when file could not be created properly. Change-Id: I2a53caa3f86e5fd43431e5421cb79e2f76d79884
Diffstat (limited to 'audio_a2dp_hw')
-rw-r--r--audio_a2dp_hw/audio_a2dp_hw.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/audio_a2dp_hw/audio_a2dp_hw.c b/audio_a2dp_hw/audio_a2dp_hw.c
index a37cf2d39..5b93992a8 100644
--- a/audio_a2dp_hw/audio_a2dp_hw.c
+++ b/audio_a2dp_hw/audio_a2dp_hw.c
@@ -1237,7 +1237,8 @@ static void adev_close_output_stream(struct audio_hw_device *dev,
#ifdef BT_AUDIO_SAMPLE_LOG
ALOGV("close file output");
- fclose (outputpcmsamplefile);
+ if (outputpcmsamplefile)
+ fclose (outputpcmsamplefile);
#endif
skt_disconnect(out->common.ctrl_fd);