Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f35fe4be authored by Felipe F. Tonello's avatar Felipe F. Tonello Committed by Felipe Balbi
Browse files

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: default avatarFelipe F. Tonello <eu@felipetonello.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 2e6c72b6
Loading
Loading
Loading
Loading
+9 −3
Original line number Original line Diff line number Diff line
@@ -547,11 +547,17 @@ 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)
{
{