diff options
Diffstat (limited to 'kernel/drivers/usb/gadget/legacy/inode.c')
-rw-r--r-- | kernel/drivers/usb/gadget/legacy/inode.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/kernel/drivers/usb/gadget/legacy/inode.c b/kernel/drivers/usb/gadget/legacy/inode.c index 7b6da0fde..b20a60343 100644 --- a/kernel/drivers/usb/gadget/legacy/inode.c +++ b/kernel/drivers/usb/gadget/legacy/inode.c @@ -769,9 +769,12 @@ ep_config (struct ep_data *data, const char *buf, size_t len) if (data->dev->state == STATE_DEV_UNBOUND) { value = -ENOENT; goto gone; - } else if ((ep = data->ep) == NULL) { - value = -ENODEV; - goto gone; + } else { + ep = data->ep; + if (ep == NULL) { + value = -ENODEV; + goto gone; + } } switch (data->dev->gadget->speed) { case USB_SPEED_LOW: |