summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrioskao <rioskao@google.com>2021-01-19 18:01:07 +0800
committerrioskao <rioskao@google.com>2021-01-19 18:01:07 +0800
commit74fa89e4635f22d593594161ac4993333a6de2d5 (patch)
treeecd8854af89d5ffbfdc8c069998906b0fd727e7a
parentccd1565642bce227aa4b9195d0d74b4487fce06e (diff)
downloadsound_trigger_hal-74fa89e4635f22d593594161ac4993333a6de2d5.tar.gz
sthal: add initial value to avoid invalid close
note: Missing the initial value that could meet the invalid close() that detected by fdsan. Bug: 177326744 Test: Build Pass Change-Id: I3b4daca3f83bc53dc8de6bb430bdf990b0c9b485
-rw-r--r--sound_trigger_hw_iaxxx.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound_trigger_hw_iaxxx.c b/sound_trigger_hw_iaxxx.c
index e3d34ff..5225091 100644
--- a/sound_trigger_hw_iaxxx.c
+++ b/sound_trigger_hw_iaxxx.c
@@ -3560,6 +3560,9 @@ static int stdev_open(const hw_module_t *module, const char *name,
stdev->device.get_properties_extended = stdev_get_properties_extended;
stdev->opened = true;
+ stdev->send_sock = -1;
+ stdev->recv_sock = -1;
+
/* Initialize all member variable */
for (i = 0; i < MAX_MODELS; i++) {
stdev->models[i].type = SOUND_MODEL_TYPE_UNKNOWN;