Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6dd3587f authored by Oliver Neukum's avatar Oliver Neukum Committed by Greg Kroah-Hartman
Browse files

cdc-acm: cleanup error handling



A small update to unify error handling during probe().

Signed-off-by: default avatarOliver Neukum <ONeukum@suse.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent eccf2a4e
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -1328,11 +1328,8 @@ static int acm_probe(struct usb_interface *intf,
		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 @@ static int acm_probe(struct usb_interface *intf,
	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;