aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sound/soc/mediatek/mt8183/mt8183-afe-clk.c1
-rw-r--r--sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c1
-rw-r--r--sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c1
-rw-r--r--sound/soc/soc-topology.c13
-rw-r--r--sound/soc/sof/imx/imx-common.c2
5 files changed, 15 insertions, 3 deletions
diff --git a/sound/soc/mediatek/mt8183/mt8183-afe-clk.c b/sound/soc/mediatek/mt8183/mt8183-afe-clk.c
index 48e81c5d52fc..cc4f8f4d3dab 100644
--- a/sound/soc/mediatek/mt8183/mt8183-afe-clk.c
+++ b/sound/soc/mediatek/mt8183/mt8183-afe-clk.c
@@ -584,7 +584,6 @@ int mt8183_mck_enable(struct mtk_base_afe *afe, int mck_id, int rate)
__func__, aud_clks[div_clk_id],
rate, ret);
goto ERR_SET_MCLK_RATE;
- return ret;
}
return 0;
diff --git a/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c b/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c
index 26e7d9a7198f..078e58f1ad0b 100644
--- a/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c
+++ b/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c
@@ -811,6 +811,7 @@ static struct platform_driver mt8183_da7219_max98357_driver = {
#ifdef CONFIG_OF
.of_match_table = mt8183_da7219_max98357_dt_match,
#endif
+ .pm = &snd_soc_pm_ops,
},
.probe = mt8183_da7219_max98357_dev_probe,
};
diff --git a/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c b/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c
index 327dfad41e31..8c8340854859 100644
--- a/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c
+++ b/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c
@@ -744,6 +744,7 @@ static struct platform_driver mt8183_mt6358_ts3a227_max98357_driver = {
#ifdef CONFIG_OF
.of_match_table = mt8183_mt6358_ts3a227_max98357_dt_match,
#endif
+ .pm = &snd_soc_pm_ops,
},
.probe = mt8183_mt6358_ts3a227_max98357_dev_probe,
};
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index eb2633dd6454..950c45008e24 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -856,6 +856,9 @@ static int soc_tplg_denum_create_texts(struct soc_tplg *tplg, struct soc_enum *s
{
int i, ret;
+ if (le32_to_cpu(ec->items) > ARRAY_SIZE(ec->texts))
+ return -EINVAL;
+
se->dobj.control.dtexts =
devm_kcalloc(tplg->dev, le32_to_cpu(ec->items), sizeof(char *), GFP_KERNEL);
if (se->dobj.control.dtexts == NULL)
@@ -889,10 +892,16 @@ static int soc_tplg_denum_create_values(struct soc_tplg *tplg, struct soc_enum *
{
int i;
- if (le32_to_cpu(ec->items) > sizeof(*ec->values))
+ /*
+ * Following "if" checks if we have at most SND_SOC_TPLG_NUM_TEXTS
+ * values instead of using ARRAY_SIZE(ec->values) due to the fact that
+ * it is oversized for its purpose. Additionally it is done so because
+ * it is defined in UAPI header where it can't be easily changed.
+ */
+ if (le32_to_cpu(ec->items) > SND_SOC_TPLG_NUM_TEXTS)
return -EINVAL;
- se->dobj.control.dvalues = devm_kzalloc(tplg->dev, le32_to_cpu(ec->items) *
+ se->dobj.control.dvalues = devm_kcalloc(tplg->dev, le32_to_cpu(ec->items),
sizeof(u32),
GFP_KERNEL);
if (!se->dobj.control.dvalues)
diff --git a/sound/soc/sof/imx/imx-common.c b/sound/soc/sof/imx/imx-common.c
index 5fee637834c2..8826ef94f04a 100644
--- a/sound/soc/sof/imx/imx-common.c
+++ b/sound/soc/sof/imx/imx-common.c
@@ -47,6 +47,8 @@ void imx8_get_registers(struct snd_sof_dev *sdev,
/**
* imx8_dump() - This function is called when a panic message is
* received from the firmware.
+ * @sdev: SOF device
+ * @flags: parameter not used but required by ops prototype
*/
void imx8_dump(struct snd_sof_dev *sdev, u32 flags)
{