Commit ca4de53c authored by Michael Trimarchi's avatar Michael Trimarchi Committed by Felipe Balbi

usb: gadget: f_uac1: check return code from config_ep_by_speed

Not checking config_ep_by_speed could lead to a kernel
NULL pointer dereference error in usb_ep_enable

Cc: Felipe Balbi <balbi@ti.com>
Signed-off-by: default avatarMichael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 49a79d8b
......@@ -588,7 +588,10 @@ static int f_audio_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
if (intf == 1) {
if (alt == 1) {
config_ep_by_speed(cdev->gadget, f, out_ep);
err = config_ep_by_speed(cdev->gadget, f, out_ep);
if (err)
return err;
usb_ep_enable(out_ep);
out_ep->driver_data = audio;
audio->copy_buf = f_audio_buffer_alloc(audio_buf_size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment