usb: gadget: f_midi: check for error on usb_ep_queue
f_midi is not checking whether there is an error on usb_ep_queue request, ignoring potential problems, such as memory leaks. Signed-off-by: Felipe F. Tonello <eu@felipetonello.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
parent
2e6c72b61b
commit
f35fe4beb0
1 changed files with 9 additions and 3 deletions
|
@ -547,10 +547,16 @@ static void f_midi_transmit(struct f_midi *midi, struct usb_request *req)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (req->length > 0)
|
if (req->length > 0) {
|
||||||
usb_ep_queue(ep, req, GFP_ATOMIC);
|
int err;
|
||||||
else
|
|
||||||
|
err = usb_ep_queue(ep, req, GFP_ATOMIC);
|
||||||
|
if (err < 0)
|
||||||
|
ERROR(midi, "%s queue req: %d\n",
|
||||||
|
midi->in_ep->name, err);
|
||||||
|
} else {
|
||||||
free_ep_req(ep, req);
|
free_ep_req(ep, req);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void f_midi_in_tasklet(unsigned long data)
|
static void f_midi_in_tasklet(unsigned long data)
|
||||||
|
|
Loading…
Add table
Reference in a new issue