summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/legacy/ether.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/legacy/ether.c')
-rw-r--r--drivers/usb/gadget/legacy/ether.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/gadget/legacy/ether.c b/drivers/usb/gadget/legacy/ether.c
index 30313b233680..99c7fc0d1d59 100644
--- a/drivers/usb/gadget/legacy/ether.c
+++ b/drivers/usb/gadget/legacy/ether.c
@@ -403,8 +403,10 @@ static int eth_bind(struct usb_composite_dev *cdev)
struct usb_descriptor_header *usb_desc;
usb_desc = usb_otg_descriptor_alloc(gadget);
- if (!usb_desc)
+ if (!usb_desc) {
+ status = -ENOMEM;
goto fail1;
+ }
usb_otg_descriptor_init(gadget, usb_desc);
otg_desc[0] = usb_desc;
otg_desc[1] = NULL;