]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ASoC: stm32: sai: fix invalid use of sizeof in stm32_sai_add_mclk_provider()
authorWei Yongjun <weiyongjun1@huawei.com>
Sat, 27 Oct 2018 02:19:59 +0000 (02:19 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 14 Nov 2018 00:27:48 +0000 (16:27 -0800)
sizeof() when applied to a pointer typed expression gives the
size of the pointer, not that of the pointed data.

Fixes: 8307b2afd386 ("ASoC: stm32: sai: set sai as mclk clock provider")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/stm/stm32_sai_sub.c

index 506423d5861a780401bd780c3309539cf243b692..d4825700b63f66464938a7a8547414517cb8722e 100644 (file)
@@ -389,7 +389,7 @@ static int stm32_sai_add_mclk_provider(struct stm32_sai_sub_data *sai)
        char *mclk_name, *p, *s = (char *)pname;
        int ret, i = 0;
 
-       mclk = devm_kzalloc(dev, sizeof(mclk), GFP_KERNEL);
+       mclk = devm_kzalloc(dev, sizeof(*mclk), GFP_KERNEL);
        if (!mclk)
                return -ENOMEM;