Commit 496fa3ba authored by Wei Yongjun's avatar Wei Yongjun Committed by Mark Brown

ASoC: stm32: sai: fix invalid use of sizeof in stm32_sai_add_mclk_provider()

sizeof() when applied to a pointer typed expression gives the
size of the pointer, not that of the pointed data.

Fixes: 8307b2af ("ASoC: stm32: sai: set sai as mclk clock provider")
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 818ba93b
...@@ -389,7 +389,7 @@ static int stm32_sai_add_mclk_provider(struct stm32_sai_sub_data *sai) ...@@ -389,7 +389,7 @@ static int stm32_sai_add_mclk_provider(struct stm32_sai_sub_data *sai)
char *mclk_name, *p, *s = (char *)pname; char *mclk_name, *p, *s = (char *)pname;
int ret, i = 0; int ret, i = 0;
mclk = devm_kzalloc(dev, sizeof(mclk), GFP_KERNEL); mclk = devm_kzalloc(dev, sizeof(*mclk), GFP_KERNEL);
if (!mclk) if (!mclk)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment