提交 2a29c651 编写于 作者: C Christophe JAILLET 提交者: Yang Yingliang

usb: gadget: audio: Fix a missing error return value in audio_bind()

commit 19b94c1f9c9a16d41a8de3ccbdb8536cf1aecdbf upstream.

If 'usb_otg_descriptor_alloc()' fails, we must return an error code, not 0.

Fixes: 56023ce0 ("usb: gadget: audio: allocate and init otg descriptor by otg capabilities")
Reviewed-by: NPeter Chen <peter.chen@nxp.com>
Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: NFelipe Balbi <balbi@kernel.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 97f1e0b4
...@@ -300,8 +300,10 @@ static int audio_bind(struct usb_composite_dev *cdev) ...@@ -300,8 +300,10 @@ static int audio_bind(struct usb_composite_dev *cdev)
struct usb_descriptor_header *usb_desc; struct usb_descriptor_header *usb_desc;
usb_desc = usb_otg_descriptor_alloc(cdev->gadget); usb_desc = usb_otg_descriptor_alloc(cdev->gadget);
if (!usb_desc) if (!usb_desc) {
status = -ENOMEM;
goto fail; goto fail;
}
usb_otg_descriptor_init(cdev->gadget, usb_desc); usb_otg_descriptor_init(cdev->gadget, usb_desc);
otg_desc[0] = usb_desc; otg_desc[0] = usb_desc;
otg_desc[1] = NULL; otg_desc[1] = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册