diff options
| author | Meng Wang <mwang@codeaurora.org> | 2017-03-21 11:16:24 +0800 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-04-05 04:14:29 -0700 |
| commit | e06bfb9b82a14f5ba79a352de828ad66773a2a4f (patch) | |
| tree | 1014418bf12c447b1daa0fe73524070199306b15 | |
| parent | 26db194916bdb891d9b2865d38cbe8068760d8ce (diff) | |
ASoC: wcd934x: add null check for soundwire control data
Soundwire control data is NULL if there is no soundwire slave
device enumerated.
Add null check to avoid panic.
Change-Id: Ief60d69c36c2a9831825f38da2c9a3f6dd5f13dc
CRs-Fixed: 2020293
Signed-off-by: Meng Wang <mwang@codeaurora.org>
| -rw-r--r-- | sound/soc/codecs/wcd934x/wcd934x.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/soc/codecs/wcd934x/wcd934x.c b/sound/soc/codecs/wcd934x/wcd934x.c index cc8e45d77fcd..e125ed8c2a16 100644 --- a/sound/soc/codecs/wcd934x/wcd934x.c +++ b/sound/soc/codecs/wcd934x/wcd934x.c @@ -9076,8 +9076,9 @@ static int tavil_device_down(struct wcd9xxx *wcd9xxx) codec = (struct snd_soc_codec *)(wcd9xxx->ssr_priv); priv = snd_soc_codec_get_drvdata(codec); - swrm_wcd_notify(priv->swr.ctrl_data[0].swr_pdev, - SWR_DEVICE_DOWN, NULL); + if (priv->swr.ctrl_data) + swrm_wcd_notify(priv->swr.ctrl_data[0].swr_pdev, + SWR_DEVICE_DOWN, NULL); tavil_dsd_reset(priv->dsd_config); snd_soc_card_change_online_state(codec->component.card, 0); for (count = 0; count < NUM_CODEC_DAIS; count++) |
