mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
usb: gadget: audio: Fix a missing error return value in audio_bind()
commit19b94c1f9cupstream. If 'usb_otg_descriptor_alloc()' fails, we must return an error code, not 0. Fixes:56023ce0fd("usb: gadget: audio: allocate and init otg descriptor by otg capabilities") Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Felipe Balbi <balbi@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Chris
parent
e7d8110180
commit
fe745e8b8e
@@ -249,8 +249,10 @@ static int audio_bind(struct usb_composite_dev *cdev)
|
||||
struct usb_descriptor_header *usb_desc;
|
||||
|
||||
usb_desc = usb_otg_descriptor_alloc(cdev->gadget);
|
||||
if (!usb_desc)
|
||||
if (!usb_desc) {
|
||||
status = -ENOMEM;
|
||||
goto fail;
|
||||
}
|
||||
usb_otg_descriptor_init(cdev->gadget, usb_desc);
|
||||
otg_desc[0] = usb_desc;
|
||||
otg_desc[1] = NULL;
|
||||
|
||||
Reference in New Issue
Block a user