提交 bc6cf366 编写于 作者: J Johan Hovold 提交者: Greg Kroah-Hartman

serdev: fix memleak on module unload

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

Fixes: cd6484e1 ("serdev: Introduce new bus for serial attached devices")
Cc: stable <stable@vger.kernel.org>	# 4.11
Signed-off-by: NJohan Hovold <johan@kernel.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 20dcff43
...@@ -617,6 +617,7 @@ EXPORT_SYMBOL_GPL(__serdev_device_driver_register); ...@@ -617,6 +617,7 @@ EXPORT_SYMBOL_GPL(__serdev_device_driver_register);
static void __exit serdev_exit(void) static void __exit serdev_exit(void)
{ {
bus_unregister(&serdev_bus_type); bus_unregister(&serdev_bus_type);
ida_destroy(&ctrl_ida);
} }
module_exit(serdev_exit); module_exit(serdev_exit);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册