Skip to contentSkip to conversation

usb: cdc-acm: Decrement tty port's refcount if probe() fail

DISCUSSION Oliver Neukum 1 participant 1 message Jun 21, 2018 USB

lore
Share & tools
lore

Oliver Neukum

author Acked-by
#0 lore raw
Quoted 10 lines · Jaejoong Kim

The cdc-acm driver does not have a refcount of itself, but uses a tty_port's refcount. That is, if the refcount of tty_port is '0', we can clean up the cdc-acm driver by calling the .destruct() callback function of struct tty_port_operations.

The problem is the destruct() callback function is not called if the probe() fails, because tty_port's refcount is not zero. So, add tty_port_put() when probe() fails.

---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html