Skip to contentSkip to conversation

serdev: fix memleak on module unload

PATCH New Johan Hovold 1 participant 1 message Jun 13, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 serdev: fix memleak on module unload

Make sure to free all resources associated with the ida on module exit.

Fixes cd6484e1830b ("serdev: Introduce new bus for serial attached devices")
Cc stable <[email protected]> # 4.11
---
 drivers/tty/serdev/core.c | 1 +
 1 file changed, 1 insertion(+)
drivers/tty/serdev/core.c +1 -0
index df93b727e984..9e59f4788589 100644
@@ -617,6 +617,7 @@ EXPORT_SYMBOL_GPL(__serdev_device_driver_register);
 static void __exit serdev_exit(void)
 {
 	bus_unregister(&serdev_bus_type);
+	ida_destroy(&ctrl_ida);
 }
 module_exit(serdev_exit);
 
Signature · 1 line
2.17.1