aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/class/cdc-acm.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-09-27 16:34:40 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-09-27 16:34:40 +0200
commitae9a6149884e04b3460bd9d7ffe29c5ec8d223d8 (patch)
tree373e19c07802ce43862f4a37a141f628bca0a401 /drivers/usb/class/cdc-acm.c
parent8217f07a50236779880f13e87f99224cd9117f83 (diff)
parent5816b3e6577eaa676ceb00a848f0fd65fe2adc29 (diff)
downloadlinux-ae9a6149884e04b3460bd9d7ffe29c5ec8d223d8.tar.gz
Merge 5.15-rc3 into usb-next
We need the USB fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/class/cdc-acm.c')
-rw-r--r--drivers/usb/class/cdc-acm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index d77e30625f4d3d..1a84b24d199f65 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -726,7 +726,8 @@ static void acm_port_destruct(struct tty_port *port)
{
struct acm *acm = container_of(port, struct acm, port);
- acm_release_minor(acm);
+ if (acm->minor != ACM_MINOR_INVALID)
+ acm_release_minor(acm);
usb_put_intf(acm->control);
kfree(acm->country_codes);
kfree(acm);
@@ -1323,8 +1324,10 @@ made_compressed_probe:
usb_get_intf(acm->control); /* undone in destruct() */
minor = acm_alloc_minor(acm);
- if (minor < 0)
+ if (minor < 0) {
+ acm->minor = ACM_MINOR_INVALID;
goto err_put_port;
+ }
acm->minor = minor;
acm->dev = usb_dev;