Skip to content

Commit

Permalink
usb: gadget: f_midi: fix leak on failed to enqueue out requests
Browse files Browse the repository at this point in the history
This patch fixes a memory leak that occurs when an endpoint fails to enqueue
the request. If that happens the complete function will never be called, thus
never freeing the request.

Signed-off-by: Felipe F. Tonello <eu@felipetonello.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Felipe F. Tonello authored and Felipe Balbi committed Nov 19, 2015
1 parent e9ca7e4 commit ad0d1a0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/usb/gadget/function/f_midi.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ static int f_midi_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
if (err) {
ERROR(midi, "%s queue req: %d\n",
midi->out_ep->name, err);
free_ep_req(midi->out_ep, req);
}
}

Expand Down

0 comments on commit ad0d1a0

Please sign in to comment.