From: Johan Hovold Date: Wed, 13 Jun 2018 15:08:59 +0000 (+0200) Subject: serdev: fix memleak on module unload X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=bc6cf3669d22371f573ab0305b3abf13887c0786;p=openwrt%2Fstaging%2Fblogic.git 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 # 4.11 Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c index df93b727e984..9e59f4788589 100644 --- a/drivers/tty/serdev/core.c +++ b/drivers/tty/serdev/core.c @@ -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);