diff options
author | Oliver Neukum | 2016-07-14 15:41:32 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2016-07-18 08:46:57 -0700 |
commit | 6dd3587f515ec4b1b8bcaaeb628ed1921eeed2ea (patch) | |
tree | 7584e93ddb0ebd4a49a0db45cd7bfa3ddb749cee /drivers/usb/class | |
parent | eccf2a4e6b64d249929acc1f7aaa2ab0fb199d3d (diff) |
cdc-acm: cleanup error handling
A small update to unify error handling during probe().
Signed-off-by: Oliver Neukum <ONeukum@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/class')
-rw-r--r-- | drivers/usb/class/cdc-acm.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 561baed7ba01..2e5dea866b6f 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c @@ -1328,11 +1328,8 @@ made_compressed_probe: goto alloc_fail; minor = acm_alloc_minor(acm); - if (minor < 0) { - dev_err(&intf->dev, "no more free acm devices\n"); - kfree(acm); - return -ENODEV; - } + if (minor < 0) + goto alloc_fail1; ctrlsize = usb_endpoint_maxp(epctrl); readsize = usb_endpoint_maxp(epread) * @@ -1523,6 +1520,7 @@ alloc_fail4: usb_free_coherent(usb_dev, ctrlsize, acm->ctrl_buffer, acm->ctrl_dma); alloc_fail2: acm_release_minor(acm); +alloc_fail1: kfree(acm); alloc_fail: return rv; |