Browse Source

usb: gadget: f_thor: Free the allocated out request buffer

Fix the memory leak by freeing the allocated out request buffer

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Siva Durga Prasad Paladugu 9 years ago
parent
commit
bab0146ea9
1 changed files with 1 additions and 0 deletions
  1. 1 0
      drivers/usb/gadget/f_thor.c

+ 1 - 0
drivers/usb/gadget/f_thor.c

@@ -891,6 +891,7 @@ static void thor_func_disable(struct usb_function *f)
 	}
 
 	if (dev->out_ep->driver_data) {
+		free(dev->out_req->buf);
 		dev->out_req->buf = NULL;
 		usb_ep_free_request(dev->out_ep, dev->out_req);
 		usb_ep_disable(dev->out_ep);