diff options
author | Simon Glass | 2023-01-17 10:47:35 -0700 |
---|---|---|
committer | Tom Rini | 2023-01-23 18:11:40 -0500 |
commit | ecdf3ab01f66585d0cb630b3ec28981dd4e7adff (patch) | |
tree | a6a3a53b49d1028455f154731adee883e54ca4aa /drivers/usb | |
parent | c7b63d500df707bd9c9041e0dae3a25f56098978 (diff) |
dm: usb: Mark the device name as alloced when binding
Since usb_find_and_bind_driver() allocates the device name it should tell
driver about that, to avoid memory leaks. Fix this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/host/usb-uclass.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/host/usb-uclass.c b/drivers/usb/host/usb-uclass.c index 93c318c3d1d..28f7ca9654d 100644 --- a/drivers/usb/host/usb-uclass.c +++ b/drivers/usb/host/usb-uclass.c @@ -563,6 +563,8 @@ static int usb_find_and_bind_driver(struct udevice *parent, if (!str) return -ENOMEM; ret = device_bind_driver(parent, "usb_dev_generic_drv", str, devp); + if (!ret) + device_set_name_alloced(*devp); error: debug("%s: No match found: %d\n", __func__, ret); |