From 50e81116ef576b58384c8829bd767b5decbc2968 Mon Sep 17 00:00:00 2001 From: Lucas Tanure Date: Fri, 17 Feb 2023 11:08:44 +0000 Subject: [PATCH] ASoC: amd: vangogh: use sizeof of variable instead of struct type Use sizeof(*machine) instead of sizeof(struct acp5x_platform_info) There is a possibility of bug when variable type has changed but corresponding struct passed to the sizeof has not. Signed-off-by: Lucas Tanure Link: https://lore.kernel.org/r/20230217110850.1045250-4-lucas.tanure@collabora.com Signed-off-by: Mark Brown --- sound/soc/amd/vangogh/acp5x-mach.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/amd/vangogh/acp5x-mach.c b/sound/soc/amd/vangogh/acp5x-mach.c index f914f6327cda..43c80103d138 100644 --- a/sound/soc/amd/vangogh/acp5x-mach.c +++ b/sound/soc/amd/vangogh/acp5x-mach.c @@ -342,7 +342,7 @@ static int acp5x_probe(struct platform_device *pdev) struct snd_soc_card *card; int ret; - machine = devm_kzalloc(dev, sizeof(struct acp5x_platform_info), GFP_KERNEL); + machine = devm_kzalloc(dev, sizeof(*machine), GFP_KERNEL); if (!machine) return -ENOMEM;