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 <raag.jadav@intel.com>
Link: https://patch.msgid.link/20250228062812.150004-3-raag.jadav@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Raag Jadav
2025-02-28 11:58:08 +05:30
committed by Mark Brown
parent 0bd862846e
commit 3e706be02b

View File

@@ -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;