From 30ef1d9262c14197fe630258193f9e15d663a400 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Mon, 9 Jun 2025 16:28:14 +0200 Subject: [PATCH] ASoC: SOF: Intel: hda: do not use missing devm_kmalloc_array() JIRA: https://issues.redhat.com/browse/RHEL-80657 Upstream-status: RHEL-only Signed-off-by: Jaroslav Kysela --- sound/soc/sof/intel/hda.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c index 5cf3d02d40f2..434d08250cdf 100644 --- a/sound/soc/sof/intel/hda.c +++ b/sound/soc/sof/intel/hda.c @@ -1053,8 +1053,7 @@ static void hda_generic_machine_select(struct snd_sof_dev *sdev, * make a local copy of the match array since we might * be modifying it */ - hda_mach = devm_kmemdup_array(sdev->dev, - snd_soc_acpi_intel_hda_machines, + hda_mach = devm_kmalloc_array(sdev->dev, 2, /* we have one entry + sentinel in the array */ sizeof(snd_soc_acpi_intel_hda_machines[0]), GFP_KERNEL); @@ -1064,6 +1063,7 @@ static void hda_generic_machine_select(struct snd_sof_dev *sdev, __func__); return; } + memcpy(hda_mach, snd_soc_acpi_intel_hda_machines, 2 * sizeof(snd_soc_acpi_intel_hda_machines[0])); dev_info(bus->dev, "using HDA machine driver %s now\n", hda_mach->drv_name);