Re: [PATCH v3 16/20] ASoC: hdac_hdmi: use devm_kmemdup_array()

Andy Shevchenko
2025-02-03T09:52:13Z

On Mon, Feb 03, 2025 at 01:38:58PM +0530, Raag Jadav wrote:
> Convert to use devm_kmemdup_array() which is more robust.

...

> - se->texts = devm_kmemdup(&hdev->dev, items,
> - (num_items * sizeof(char *)), GFP_KERNEL);
> + se->texts = devm_kmemdup_array(&hdev->dev, items, num_items, sizeof(char *), GFP_KERNEL);

In similar way, sizeof(*se->texts) ?

> if (!se->texts)
> return -ENOMEM;

--
With Best Regards,
Andy Shevchenko