Re: [PATCH 2/3] pinctrl: bcm: Use pinconf_generic_dt_free_map in bcm2835

From: Florian Fainelli

Date: Tue Nov 10 2026 - 12:59:38 EST


On 11/5/26 23:06, Wang Xiaolei wrote:
Replace the hand-written dt_free_map callback with the generic
pinconf_generic_dt_free_map() helper, which wraps
pinctrl_utils_free_map(). This drops the duplicated free loop and
handles both CONFIGS_PIN and CONFIGS_GROUP map types.

The error path in bcm2835_pctl_dt_node_to_map() uses the same helper.
The driver already selects GENERIC_PINCONF, so no Kconfig change is
needed.

Signed-off-by: Wang Xiaolei <wangxiaolei01@xxxxxxxxxxx>

I think this deserves a Fixes: tag because it fixes a memory leak, generic allocation can allocate PIN_MAP_TYPE_CONFIGS_GROUP, but the custom callback does not free that allocation type:

Fixes: 0de704955ee4 ("pinctrl: bcm2835: Add support for generic pinctrl binding")
Reviewed-by: Florian Fainelli <florian.fainelli@xxxxxxxxxxxx>
--
Florian