On 2026-07-03T09:11:23, Peng Fan <[email protected]> wrote: > dm: core: free old name in device_set_name to prevent leak > > If device_set_name is called on a device that already has > DM_FLAG_NAME_ALLOCED set, the old dynamically-allocated name is leaked. > Free it before assigning the new name. > > See: drivers/net/mdio_gpio.c:mdio_gpio_bind(). There is > device_set_name() here, however dm_mdio_post_bind() will also call > device_set_name() if 'device-name' exists. > > Signed-off-by: Peng Fan <[email protected]> > > drivers/core/device.c | 2 ++ > 1 file changed, 2 insertions(+)
Reviewed-by: Simon Glass <[email protected]>

