diff options
author | Charles Keepax <ckeepax@opensource.wolfsonmicro.com> | 2014-09-09 16:51:49 +0100 |
---|---|---|
committer | Zefan Li <lizefan@huawei.com> | 2014-12-01 18:02:32 +0800 |
commit | 87fd5ce262733a437d0135741c6621f5418e6ede (patch) | |
tree | 61ba1d3b4ed34b882ebd20021113c0272209bc20 | |
parent | 1f8f277312d81d9412ec94bec8ab1ba0dce0bf05 (diff) |
ASoC: samsung-i2s: Check secondary DAI exists before referencing
commit 133c2681c4a0c1b589d138c2fdd0f131bdce20ed upstream.
In a couple of places the driver is missing a check to ensure there is a
secondary DAI before it de-references the pointer to it, causing a null
pointer de-reference. This patch adds a check to avoid this.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
[lizf: Backported to 3.4: drop the changes to i2s_shutdown()]
Signed-off-by: Zefan Li <lizefan@huawei.com>
-rw-r--r-- | sound/soc/samsung/i2s.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 6ac7b8281a02..9998719cc02f 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -392,7 +392,7 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai, if (dir == SND_SOC_CLOCK_IN) rfs = 0; - if ((rfs && other->rfs && (other->rfs != rfs)) || + if ((rfs && other && other->rfs && (other->rfs != rfs)) || (any_active(i2s) && (((dir == SND_SOC_CLOCK_IN) && !(mod & MOD_CDCLKCON)) || |