From: Siva Durga Prasad Paladugu <siva.durga.palad...@xilinx.com> Fix the memory leak by freeing the allocated out request buffer
Signed-off-by: Siva Durga Prasad Paladugu <siva...@xilinx.com> Signed-off-by: Michal Simek <michal.si...@xilinx.com> --- drivers/usb/gadget/f_thor.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/gadget/f_thor.c b/drivers/usb/gadget/f_thor.c index a60e9487e774..75b72902c9d5 100644 --- a/drivers/usb/gadget/f_thor.c +++ b/drivers/usb/gadget/f_thor.c @@ -51,6 +51,7 @@ DEFINE_CACHE_ALIGN_BUFFER(unsigned char, thor_rx_data_buf, DEFINE_CACHE_ALIGN_BUFFER(char, f_name, F_NAME_BUF_SIZE); static unsigned long long int thor_file_size; static int alt_setting_num; +static void *out_req_buf; static void send_rsp(const struct rsp_box *rsp) { @@ -891,6 +892,8 @@ static void thor_func_disable(struct usb_function *f) } if (dev->out_ep->driver_data) { + if (out_req_buf) + free(out_req_buf); dev->out_req->buf = NULL; usb_ep_free_request(dev->out_ep, dev->out_req); usb_ep_disable(dev->out_ep); @@ -947,6 +950,7 @@ static int thor_eps_setup(struct usb_function *f) } dev->out_req = req; + out_req_buf = dev->out_req->buf; /* ACM control EP */ ep = dev->int_ep; ep->driver_data = cdev; /* claim */ -- 1.9.1 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot