提交 f35fe4be 编写于 作者: F Felipe F. Tonello 提交者: Felipe Balbi

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: NFelipe F. Tonello <eu@felipetonello.com>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 2e6c72b6
......@@ -547,10 +547,16 @@ static void f_midi_transmit(struct f_midi *midi, struct usb_request *req)
}
}
if (req->length > 0)
usb_ep_queue(ep, req, GFP_ATOMIC);
else
if (req->length > 0) {
int err;
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);
}
}
static void f_midi_in_tasklet(unsigned long data)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册