[U-Boot] [U-Boot, 01/10] usb: gadget: don't leak configs when unbinding

Tom Rini trini at konsulko.com
Sat Sep 12 14:51:10 CEST 2015


On Fri, Sep 04, 2015 at 10:03:42PM -0600, Stephen Warren wrote:

> From: Stephen Warren <swarren at nvidia.com>
> 
> By the time g_dnl_unbind() is run, cdev->config has been set to NULL,
> so the free() there does nothing, and the config struct is leaked.
> Equally, struct usb_gadget contains a linked list of config structs, so
> the code should iterate over them all and free each one, rather than
> freeing one particular config struct.
> 
> composite_unbind() already iterates over the list of config structs, and
> unlinks each from the linked list. Fix this loop to free() each struct as
> it's unlinked and otherwise forgotten.
> 
> Signed-off-by: Stephen Warren <swarren at nvidia.com>
> Acked-by: Lukasz Majewski <l.majewski at samsung.com>
> Tested-by: Lukasz Majewski <l.majewski at samsung.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150912/e0a8d093/attachment.sig>


More information about the U-Boot mailing list