mirror of
https://github.com/torvalds/linux.git
synced 2026-05-21 05:18:45 +02:00
power: supply: sc27xx: use devm_kmemdup_array()
Convert to use devm_kmemdup_array() which is more robust. Signed-off-by: Raag Jadav <raag.jadav@intel.com> Link: https://lore.kernel.org/r/20250221165333.2780888-9-raag.jadav@intel.com Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
This commit is contained in:
parent
46671aae44
commit
76d5fb0e58
|
|
@ -1014,9 +1014,8 @@ static int sc27xx_fgu_hw_init(struct sc27xx_fgu_data *data)
|
|||
if (!table)
|
||||
return -EINVAL;
|
||||
|
||||
data->cap_table = devm_kmemdup(data->dev, table,
|
||||
data->table_len * sizeof(*table),
|
||||
GFP_KERNEL);
|
||||
data->cap_table = devm_kmemdup_array(data->dev, table, data->table_len,
|
||||
sizeof(*table), GFP_KERNEL);
|
||||
if (!data->cap_table) {
|
||||
power_supply_put_battery_info(data->battery, info);
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user