Re: [PATCH v3 17/20] ASoC: tlv320dac33: use devm_kmemdup_array()

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

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

...

> - dac33->reg_cache = devm_kmemdup(&client->dev,
> - dac33_reg,
> - ARRAY_SIZE(dac33_reg) * sizeof(u8),
> - GFP_KERNEL);
> + dac33->reg_cache = devm_kmemdup_array(&client->dev, dac33_reg, ARRAY_SIZE(dac33_reg),
> + sizeof(u8), GFP_KERNEL);

sizeof(*dac33->reg_cache) ?

> if (!dac33->reg_cache)
> return -ENOMEM;

--
With Best Regards,
Andy Shevchenko