usb: gadget: f_midi: check for error on usb_ep_queue
PATCH 3/3 usb: gadget: f_midi: check for error on usb_ep_queue
From: "Felipe F. Tonello" <[email protected]>
f_midi is not checking whether there is an error on usb_ep_queue request, ignoring potential problems, such as memory leaks.
---
Changes for v2:
- Update code style.
Changes for v3:
- Use ip_ep instead of out_ep. Fixed typo in commit message.
drivers/usb/gadget/function/f_midi.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/usb/gadget/function/f_midi.c +9 -3
@@ -543,10 +543,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)
Signature · 1 line
2.1.4
Hi Balbi,
Quoted 5 lines · On Fri, Sep 18, 2015 at 6:36 PM, <[email protected]> wrote:
From: "Felipe F. Tonello" <[email protected]>
f_midiis not checking whether there is an error onusb_ep_queuerequest, ignoring potential problems, such as memory leaks.
Quoted 8 lines
Signed-off-by Felipe F. Tonello <[email protected]>---
Changes for v2:
- Update code style.Changes for v3:
- Useip_epinstead ofout_ep. Fixed typo in commit message.
I forgot to add v3 to the patch subject, so it queued here instead. Do you want me to re-send as v3?
Felipe Tonello
Hi,
Quoted 11 lines · Felipe Tonello
Hi Balbi,
Quoted 8 lines · On Fri, Sep 18, 2015 at 6:36 PM, <[email protected]> wrote:
From: "Felipe F. Tonello" <[email protected]>
f_midiis not checking whether there is an error onusb_ep_queuerequest, ignoring potential problems, such as memory leaks.Signed-off-by Felipe F. Tonello <[email protected]>---
Quoted 8 lines
Quoted 5 lines
Changes for v2:
- Update code style.Changes for v3:
- Useip_epinstead ofout_ep. Fixed typo in commit message.I forgot to add v3 to the patch subject, so it queued here instead. Do you want me to re-send as v3?
you need to ask Peter, he's the chipidea maintainer. Peter ?
Signature · 1 line
balbi
Quoted 17 lines · Felipe Balbi
Hi,
Quoted 14 lines · Felipe Tonello
Hi Balbi,
Quoted 11 lines · On Fri, Sep 18, 2015 at 6:36 PM, <[email protected]> wrote:
From: "Felipe F. Tonello" <[email protected]>
f_midiis not checking whether there is an error onusb_ep_queuerequest, ignoring potential problems, such as memory leaks.Signed-off-by Felipe F. Tonello <[email protected]>---
Changes for v2:
- Update code style.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Changes for v3:
- Useip_epinstead ofout_ep. Fixed typo in commit message.I forgot to add v3 to the patch subject, so it queued here instead. Do you want me to re-send as v3?
you need to ask Peter, he's the chipidea maintainer. Peter ?
I have queued the first two for chipidea changes, the third one is for gadget change.
Signature · 2 lines
Best Regards, Peter Chen