Re: [PATCH v3 18/20] ASoC: uda1380: use devm_kmemdup_array()

Andy Shevchenko
2025-02-03T09:57:14Z

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

...

> - uda1380->reg_cache = devm_kmemdup(&i2c->dev,
> - uda1380_reg,
> - ARRAY_SIZE(uda1380_reg) * sizeof(u16),
> - GFP_KERNEL);
> + uda1380->reg_cache = devm_kmemdup_array(&i2c->dev, uda1380_reg, ARRAY_SIZE(uda1380_reg),
> + sizeof(u16), GFP_KERNEL);

sizeof(*uda1380->reg_cache) ?

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

--
With Best Regards,
Andy Shevchenko