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

Commit 33dbb2a7 authored by Phani Kumar Uppalapati's avatar Phani Kumar Uppalapati Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: wcd934x: Check for null pointer before access



Check dsd config structure pointer for null before
access to prevent kernel panic.

CRs-fixed: 1070189
Change-Id: I791941fbede4b136c3f24d15b7fb0b60dd5477e6
Signed-off-by: default avatarPhani Kumar Uppalapati <phaniu@codeaurora.org>
parent 626caf4e
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -378,6 +378,11 @@ static int tavil_enable_dsd(struct snd_soc_dapm_widget *w,
	int interp_idx;
	u8 pcm_rate_val;

	if (!dsd_conf) {
		dev_err(codec->dev, "%s: null dsd_config pointer\n", __func__);
		return -EINVAL;
	}

	if (w->shift == DSD0) {
		/* Read out select */
		if (snd_soc_read(codec, WCD934X_CDC_DSD0_CFG0) & 0x02)