Re: [PATCH] regulator: core: Protect regulator_supply_alias_list with regulator_list_mutex

From: Mark Brown

Date: Wed Nov 26 2025 - 09:52:01 EST


On Wed, Nov 26, 2025 at 02:44:06PM +0000, Charles Keepax wrote:
> On Wed, Nov 26, 2025 at 02:15:42PM +0800, sparkhuang wrote:

> > + new_map->src_supply = id;
> > + new_map->alias_dev = alias_dev;
> > + new_map->alias_supply = alias_id;
> > list_add(&map->list, &regulator_supply_alias_list);

> In addition to Mark's comment the first argument here should be
> the new item to add. Personally I would be inclined to just leave
> the allocation inside the lock and not require the extra variable
> but up to you.

It is generally nicer to keep the locked region as small as possible.

Attachment: signature.asc
Description: PGP signature