Message ID | 20250203080902.1864382-19-raag.jadav@intel.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | Split devres APIs to device/devres.h and introduce devm_kmemdup_array() | expand |
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;
diff --git a/sound/soc/codecs/uda1380.c b/sound/soc/codecs/uda1380.c index 4f8fdd574585..6b474f9ee7c4 100644 --- a/sound/soc/codecs/uda1380.c +++ b/sound/soc/codecs/uda1380.c @@ -766,10 +766,8 @@ static int uda1380_i2c_probe(struct i2c_client *i2c) return ret; } - 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); if (!uda1380->reg_cache) return -ENOMEM;
Convert to use devm_kmemdup_array() which is more robust. Signed-off-by: Raag Jadav <raag.jadav@intel.com> --- sound/soc/codecs/uda1380.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)