greybus: audio-pcm: fix use of variable unitialized
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>
Thu, 29 Oct 2015 16:58:29 +0000 (16:58 +0000)
committerGreg Kroah-Hartman <gregkh@google.com>
Mon, 2 Nov 2015 19:25:07 +0000 (11:25 -0800)
commit8417f5e56c8d67371f1810dfa0d1871f0119e89d
treefdbe225d7edc32b332487340ce71a05d812a7d56
parentb350007219f65df8594e62c731e29ff3ad2f4d61
greybus: audio-pcm: fix use of variable unitialized

Compiling with clang shows that period_elapsed will be used as a branch
conditional unitialized whenever snd_dev->transfer_done <
runtime->period_size. Since stack can grow up/down as we proceed though
the call stack this should be fixed. This patch fixes by explicitly
initalizing period_elapsed to zero.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Mark Greer <mgreer@animalcreek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/audio-pcm.c