dai-zephyr: handle dai_config_get() errors properly

Add error check in dai_get_hw_params() for the case where
dai_config_get() returns an error.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
This commit is contained in:
Kai Vehmanen 2023-01-02 12:22:59 +02:00 committed by Liam Girdwood
parent 2b85c2c358
commit 1b02c92eff
1 changed files with 3 additions and 0 deletions

View File

@ -165,6 +165,9 @@ static int dai_get_hw_params(struct dai *dai, struct sof_ipc_stream_params *par
{
const struct dai_config *cfg = dai_config_get(dai->dev, dir);
if (!cfg)
return -EINVAL;
params->rate = cfg->rate;
params->buffer_fmt = 0;
params->channels = cfg->channels;