Commit 5c1ac694 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

greybus: properly cleanup ida and idr structures when shutting down



idr and ida structures have internal memory allocated that needs to be
freed when modules are removed.  So call the proper idr_destroy() or
ida_destroy() functions on the module exit path to free the memory.

Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
Reviewed-by: default avatarAlex Elder <elder@linaro.org>
parent 6ceb8fde
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -364,6 +364,7 @@ static void __exit raw_exit(void)
	gb_protocol_deregister(&raw_protocol);
	unregister_chrdev_region(MKDEV(raw_major, 0), NUM_MINORS);
	class_destroy(raw_class);
	ida_destroy(&minors);
}
module_exit(raw_exit);

+1 −0
Original line number Diff line number Diff line
@@ -761,6 +761,7 @@ static void gb_tty_exit(void)
{
	tty_unregister_driver(gb_tty_driver);
	put_tty_driver(gb_tty_driver);
	idr_destroy(&tty_minors);
}

static struct gb_protocol uart_protocol = {
+1 −0
Original line number Diff line number Diff line
@@ -190,6 +190,7 @@ static __exit void protocol_exit(void)
{
	gb_protocol_deregister(&vibrator_protocol);
	class_unregister(&vibrator_class);
	ida_destroy(&minors);
}
module_exit(protocol_exit);