ASoC: msm: Fix a possible NULL pointer access
Change-Id: If74cf4584c20ea1b7b11113af3963f3e15389494
CRs-Fixed: 314889
Signed-off-by: Jay Wang <jaywang@codeaurora.org>
diff --git a/sound/soc/msm/msm-pcm-routing.c b/sound/soc/msm/msm-pcm-routing.c
index 3c92514..70e081c 100644
--- a/sound/soc/msm/msm-pcm-routing.c
+++ b/sound/soc/msm/msm-pcm-routing.c
@@ -913,6 +913,12 @@
bedai = &msm_bedais[be_id];
+ if (bedai->hw_params == NULL) {
+ pr_err("%s: HW param is not configured", __func__);
+ return -EINVAL;
+ }
+
+
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
path_type = ADM_PATH_PLAYBACK;
session_type = SESSION_TYPE_RX;