usb: gadget: function: Added usb_assign_descriptors failure check
authorPavitrakumar Managutte <pavitra1729@gmail.com>
Mon, 27 Oct 2014 17:19:26 +0000 (22:49 +0530)
committerFelipe Balbi <balbi@ti.com>
Mon, 3 Nov 2014 16:01:24 +0000 (10:01 -0600)
Added failure check for usb_assign_descriptors call in bind function.

Acked-By: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Pavitrakumar Managutte <pavitra1729@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/function/f_ncm.c

index 16361b0a8b469644120907f5a135d3f7d5156b11..bdcda9f5148e5c42d2217fcae87be5f266c263f2 100644 (file)
@@ -1441,6 +1441,9 @@ static int ncm_bind(struct usb_configuration *c, struct usb_function *f)
 
        status = usb_assign_descriptors(f, ncm_fs_function, ncm_hs_function,
                        NULL);
+       if (status)
+               goto fail;
+
        /*
         * NOTE:  all that is done without knowing or caring about
         * the network link ... which is unavailable to this code