diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2015-06-04 16:04:14 +0300 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2015-07-03 23:02:23 -0400 |
commit | 9f62d78bb265b3c927c0d75c43c22932d05ac3c4 (patch) | |
tree | d2cdb29533fd876e37856928f5b185d3978c17b1 /sound | |
parent | b1b163a4672a37b17986ed2537a78e7e90239360 (diff) | |
download | lwn-9f62d78bb265b3c927c0d75c43c22932d05ac3c4.tar.gz lwn-9f62d78bb265b3c927c0d75c43c22932d05ac3c4.zip |
ASoC: tas2552: Fix kernel crash when the codec is loaded but not part of a card
[ Upstream commit 80ba2669ec8c3e6517aa935001f6cb8809bf3df4 ]
If the card is not part of any card the tas_data->codec is NULL since it is
set only during snd_soc_codec_driver.probe, which is not yet called.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/tas2552.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/codecs/tas2552.c b/sound/soc/codecs/tas2552.c index f039dc825971..8543a061d477 100644 --- a/sound/soc/codecs/tas2552.c +++ b/sound/soc/codecs/tas2552.c @@ -120,6 +120,9 @@ static void tas2552_sw_shutdown(struct tas2552_data *tas_data, int sw_shutdown) { u8 cfg1_reg; + if (!tas_data->codec) + return; + if (sw_shutdown) cfg1_reg = 0; else |