summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorMichael Trimarchi <michael@amarulasolutions.com>2015-05-18 17:28:58 +0200
committerFelipe Balbi <balbi@ti.com>2015-05-26 10:15:09 -0500
commitca4de53c522f261e84efb659a07435bd1a5a8828 (patch)
tree29342f7d5999daf59da2c43ec660abc5c87b5b87 /drivers/usb
parent49a79d8b0a5f8239b8424a3eb730006faada0ad8 (diff)
downloadop-kernel-dev-ca4de53c522f261e84efb659a07435bd1a5a8828.zip
op-kernel-dev-ca4de53c522f261e84efb659a07435bd1a5a8828.tar.gz
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: Michael Trimarchi <michael@amarulasolutions.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/function/f_uac1.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/gadget/function/f_uac1.c b/drivers/usb/gadget/function/f_uac1.c
index 9719abf..7856b33 100644
--- a/drivers/usb/gadget/function/f_uac1.c
+++ b/drivers/usb/gadget/function/f_uac1.c
@@ -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);
OpenPOWER on IntegriCloud