hal: Ensure all the mutexes are initialized
- Ensure all the mutex locks are initialized before using them,
to avoid native crashes.
Change-Id: I7b6253f1d08a36a24d366d69004ce969d73c13e1
CRs-Fixed: 654375
diff --git a/hal/audio_extn/usb.c b/hal/audio_extn/usb.c
index 281b445..0240d7c 100644
--- a/hal/audio_extn/usb.c
+++ b/hal/audio_extn/usb.c
@@ -580,6 +580,11 @@
usbmod->proxy_card = 0;
usbmod->proxy_device_id = AFE_PROXY_PLAYBACK_DEVICE;
usbmod->adev = (struct audio_device*)adev;
+
+ pthread_mutex_init(&usbmod->usb_playback_lock,
+ (const pthread_mutexattr_t *) NULL);
+ pthread_mutex_init(&usbmod->usb_record_lock,
+ (const pthread_mutexattr_t *) NULL);
}
void audio_extn_usb_deinit()