diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2016-08-11 12:48:43 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-08-11 12:48:43 -0700 |
| commit | 149e49b1caa2fdc365cea7f20e57dbbf51a36caf (patch) | |
| tree | 170b007a7f543942fc0abd6d60ad99f0dcb4235d | |
| parent | bbf8cef11073d170002e4f14f355de7a0cdd3ff3 (diff) | |
| parent | 442ec18acdb46caa0501d75129846ed64a6d8c23 (diff) | |
Merge "usb: gadget: f_cdev: Fix memory leak upon composition switch"
| -rw-r--r-- | drivers/usb/gadget/function/f_cdev.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/gadget/function/f_cdev.c b/drivers/usb/gadget/function/f_cdev.c index b22ea656367e..78c1ce793b5b 100644 --- a/drivers/usb/gadget/function/f_cdev.c +++ b/drivers/usb/gadget/function/f_cdev.c @@ -516,7 +516,6 @@ static void usb_cser_disable(struct usb_function *f) usb_cser_disconnect(port); usb_ep_disable(port->port_usb.notify); - usb_cser_free_req(port->port_usb.notify, port->port_usb.notify_req); port->port_usb.notify->driver_data = NULL; } @@ -817,7 +816,11 @@ static void cser_free_inst(struct usb_function_instance *fi) static void usb_cser_unbind(struct usb_configuration *c, struct usb_function *f) { + struct f_cdev *port = func_to_port(f); + usb_free_all_descriptors(f); + usb_cser_free_req(port->port_usb.notify, port->port_usb.notify_req); + port->port_usb.notify_req = NULL; } static int usb_cser_alloc_requests(struct usb_ep *ep, struct list_head *head, |
