From: Raag Jadav Date: Fri, 28 Feb 2025 06:28:08 +0000 (+0530) Subject: ASoC: hdac_hdmi: use devm_kmemdup_array() X-Git-Tag: v6.15-rc1~173^2~4^2~79^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3e706be02befae55b50b240d4360b5993f9879a8;p=thirdparty%2Flinux.git ASoC: hdac_hdmi: use devm_kmemdup_array() Convert to use devm_kmemdup_array() and while at it, make the size robust against type changes. Signed-off-by: Raag Jadav Link: https://patch.msgid.link/20250228062812.150004-3-raag.jadav@intel.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c index e1a7f0b0c0f33..3bea5d09219ae 100644 --- a/sound/soc/codecs/hdac_hdmi.c +++ b/sound/soc/codecs/hdac_hdmi.c @@ -1017,8 +1017,7 @@ static int hdac_hdmi_create_pin_port_muxs(struct hdac_device *hdev, return -ENOMEM; } - se->texts = devm_kmemdup(&hdev->dev, items, - (num_items * sizeof(char *)), GFP_KERNEL); + se->texts = devm_kmemdup_array(&hdev->dev, items, num_items, sizeof(items[0]), GFP_KERNEL); if (!se->texts) return -ENOMEM;