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

From: Mark Brown

Date: Wed Nov 26 2025 - 07:58:23 EST


On Wed, Nov 26, 2025 at 02:15:42PM +0800, sparkhuang wrote:

> - map->alias_supply = alias_id;
> + mutex_lock(&regulator_list_mutex);
> + map = regulator_find_supply_alias(dev, id);
> + if (map) {
> + mutex_unlock(&regulator_list_mutex);
> + kfree(new_map);
> + return -EEXIST;
> + }
>
> + new_map->src_dev = dev;
> + 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);
> -
> + mutex_lock(&regulator_list_mutex);

This is locking regulator_list_mutex which is already locked, I think
you meant mutex_unlock().

Attachment: signature.asc
Description: PGP signature