1
0
Fork 0

serdev: fix memleak on module unload

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

Fixes: cd6484e183 ("serdev: Introduce new bus for serial attached devices")
Cc: stable <stable@vger.kernel.org>	# 4.11
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Johan Hovold 2018-06-13 17:08:59 +02:00 committed by Greg Kroah-Hartman
parent 20dcff436e
commit bc6cf3669d

View file

@ -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);