asoc: lahaina: add ch_mask check for CPS to avoid endless loop

When ch_mask is 0, set_cps_config will enter endless loop. Add
check for ch_mask to avoid such endless loop.

Change-Id: Id2237d4f8070b2edaf3bc9690afa649e82a455f8
Signed-off-by: Meng Wang <mengw@codeaurora.org>
This commit is contained in:
Meng Wang 2021-02-01 09:59:49 +08:00
commit 518713ffc8

View file

@ -5128,6 +5128,11 @@ static void set_cps_config(struct snd_soc_pcm_runtime *rtd,
return;
}
if (!ch_mask) {
pr_err("%s: channel mask is 0\n", __func__);
return;
}
if (!pdata->get_wsa_dev_num) {
pr_err("%s: get_wsa_dev_num is NULL\n", __func__);
return;