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

Commit 4ccd0644 authored by Felipe F. Tonello's avatar Felipe F. Tonello Committed by Greg Kroah-Hartman
Browse files

usb: gadget: f_midi: fail if set_alt fails to allocate requests



commit f0f1b8cac4d8d973e95f25d9ea132775fb43c5f4 upstream.

This ensures that the midi function will only work if the proper number of
IN and OUT requrests are allocated. Otherwise the function will work with less
requests then what the user wants.

Signed-off-by: default avatarFelipe F. Tonello <eu@felipetonello.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
From: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 52a95925
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -364,9 +364,10 @@ static int f_midi_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
		req->complete = f_midi_complete;
		err = usb_ep_queue(midi->out_ep, req, GFP_ATOMIC);
		if (err) {
			ERROR(midi, "%s queue req: %d\n",
			ERROR(midi, "%s: couldn't enqueue request: %d\n",
				    midi->out_ep->name, err);
			free_ep_req(midi->out_ep, req);
			return err;
		}
	}