diff options
| author | Phani Kumar Uppalapati <phaniu@codeaurora.org> | 2016-09-26 13:33:02 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-09-26 14:59:51 -0700 |
| commit | 33dbb2a7352f8fc2e41d2eec1dd7e0dcd9fc4ec6 (patch) | |
| tree | 2c48170e0e57a279a3d492adf414621d12ec9a87 | |
| parent | 626caf4e54864d90e8d104277f9a1446e487c7e1 (diff) | |
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: Phani Kumar Uppalapati <phaniu@codeaurora.org>
| -rw-r--r-- | sound/soc/codecs/wcd934x/wcd934x-dsd.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/soc/codecs/wcd934x/wcd934x-dsd.c b/sound/soc/codecs/wcd934x/wcd934x-dsd.c index 246b3bfab876..4deb67a5a5cf 100644 --- a/sound/soc/codecs/wcd934x/wcd934x-dsd.c +++ b/sound/soc/codecs/wcd934x/wcd934x-dsd.c @@ -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) |
