From: Pavitrakumar Managutte Date: Mon, 27 Oct 2014 17:19:26 +0000 (+0530) Subject: usb: gadget: function: Added usb_assign_descriptors failure check X-Git-Tag: v3.19-rc1~80^2~32^2~129 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8b920f16e69550d3f6c7c67dc3cef42aafca498d;p=karo-tx-linux.git usb: gadget: function: Added usb_assign_descriptors failure check Added failure check for usb_assign_descriptors call in bind function. Acked-By: Sebastian Andrzej Siewior Signed-off-by: Pavitrakumar Managutte Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/gadget/function/f_ncm.c b/drivers/usb/gadget/function/f_ncm.c index 16361b0a8b46..bdcda9f5148e 100644 --- a/drivers/usb/gadget/function/f_ncm.c +++ b/drivers/usb/gadget/function/f_ncm.c @@ -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