Skip to content
Commit 241bf433 authored by Stephen Warren's avatar Stephen Warren Committed by Mark Brown
Browse files

ASoC: tegra: fix uninitialized variables in set_fmt



In tegra*_i2s_set_fmt(), in the (fmt == SND_SOC_DAIFMT_CBM_CFM) case,
"val" is never assigned to, but left uninitialized. The other case does
initialized it. Fix this by initializing val at the start of the
function, and only ever ORing into it.

Update the handling of "mask" so it works the same way for consistency.

Update tegra20_spdif.c to use the same code-style for consistency, even
though it doesn't happen to suffer from the same problem at present.

Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
Reviewed-by: default avatarThierry Reding <treding@nvidia.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
Fixes: 0f163546 ("ASoC: tegra: use regmap more directly")
Cc: <stable@vger.kernel.org>
parent 6ce4eac1
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment