]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ASoC: hdac_hdmi: use devm_kmemdup_array()
authorRaag Jadav <raag.jadav@intel.com>
Fri, 28 Feb 2025 06:28:08 +0000 (11:58 +0530)
committerMark Brown <broonie@kernel.org>
Fri, 28 Feb 2025 14:00:58 +0000 (14:00 +0000)
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>
sound/soc/codecs/hdac_hdmi.c

index e1a7f0b0c0f331fa01a85cf1b2db3ee37bf3b8d1..3bea5d09219ae95ee0cf84b32bf11340dc40b259 100644 (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;