]> Git Repo - linux.git/commitdiff
usb: gadget: audio: Fix a missing error return value in audio_bind()
authorChristophe JAILLET <[email protected]>
Sun, 3 May 2020 10:47:07 +0000 (12:47 +0200)
committerFelipe Balbi <[email protected]>
Sat, 9 May 2020 08:05:02 +0000 (11:05 +0300)
If 'usb_otg_descriptor_alloc()' fails, we must return an error code, not 0.

Fixes: 56023ce0fd70 ("usb: gadget: audio: allocate and init otg descriptor by otg capabilities")
Reviewed-by: Peter Chen <[email protected]>
Signed-off-by: Christophe JAILLET <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
drivers/usb/gadget/legacy/audio.c

index dd81fd538cb89c78543f724c99db8e1fd76a3b06..a748ed0842e8af66e330fa68e8f4dd83fd920451 100644 (file)
@@ -300,8 +300,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;
This page took 0.062011 seconds and 4 git commands to generate.