Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 316212b4 authored by Meng Wang's avatar Meng Wang Committed by Banajit Goswami
Browse files

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: default avatarMeng Wang <mwang@codeaurora.org>
parent 03d4e3ca
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -9072,6 +9072,7 @@ static int tavil_device_down(struct wcd9xxx *wcd9xxx)

	codec = (struct snd_soc_codec *)(wcd9xxx->ssr_priv);
	priv = snd_soc_codec_get_drvdata(codec);
	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);