Home
last modified time | relevance | path

Searched hist:"44 bfb43f9afab9b2944bb98bc0d514303f029ff9" (Results 1 – 2 of 2) sorted by relevance

/rk3399_rockchip-uboot/drivers/usb/gadget/
H A Dcomposite.c44bfb43f9afab9b2944bb98bc0d514303f029ff9 Sat Sep 05 04:03:42 UTC 2015 Stephen Warren <swarren@nvidia.com> usb: gadget: don't leak configs when unbinding

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@nvidia.com>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Tested-by: Lukasz Majewski <l.majewski@samsung.com>
H A Dg_dnl.c44bfb43f9afab9b2944bb98bc0d514303f029ff9 Sat Sep 05 04:03:42 UTC 2015 Stephen Warren <swarren@nvidia.com> usb: gadget: don't leak configs when unbinding

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@nvidia.com>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Tested-by: Lukasz Majewski <l.majewski@samsung.com>