summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToni Barzic <tbarzic@google.com>2017-01-04 15:06:38 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-01-12 15:58:13 -0800
commit29ff3ba4f2470ee5ac22d947f3509021541453f0 (patch)
tree61ced6513695b8e01e0b2826fd162f8276001c36
parent48000f3ece1f645c58b56ded6a526d8561dee0ba (diff)
downloadadhd-29ff3ba4f2470ee5ac22d947f3509021541453f0.tar.gz
CRAS: cras_udev - zero USB card info when created
USB card info is used to derive the device's stable ID. If any of USB properties that are part of card info is not properly initialized (which was the case when reading USB system attributes failed), stable ID will be derived from unpredictable data - and end up being unstable across reboots. BUG=chromium:678090 TEST=1. plug in USB headset, 2. change active output to another device, 3. unplug the USB headset 4. reboot 5. plug the USB headset again 6. verify that the USB headset is not activated Change-Id: I986be152ca6bd97431766d745ffa023afe973237 Reviewed-on: https://chromium-review.googlesource.com/424938 Commit-Ready: Toni Barzic <tbarzic@chromium.org> Tested-by: Toni Barzic <tbarzic@chromium.org> Reviewed-by: Hsinyu Chao <hychao@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org>
-rw-r--r--cras/src/server/cras_udev.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/cras/src/server/cras_udev.c b/cras/src/server/cras_udev.c
index 7bcad46a..2ba1fcd1 100644
--- a/cras/src/server/cras_udev.c
+++ b/cras/src/server/cras_udev.c
@@ -287,6 +287,7 @@ static void device_add_alsa(struct udev_device *dev,
unsigned internal)
{
struct cras_alsa_card_info card_info;
+ memset(&card_info, 0, sizeof(card_info));
udev_delay_for_alsa();
card_info.card_index = card;