Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f1ca7e32 authored by Kyle Yan's avatar Kyle Yan Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: gadget: f_fs: Fix memory leak for ipc_log_context" into msm-4.9

parents 6cae767b 624d3f27
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1761,6 +1761,8 @@ static int functionfs_init(void)
		pr_err("failed registering file system (%d)\n", ret);

	ffs_ipc_log = ipc_log_context_create(NUM_PAGES, "f_fs", 0);
	if (IS_ERR_OR_NULL(ffs_ipc_log))
		ffs_ipc_log =  NULL;

	return ret;
}
@@ -1771,6 +1773,11 @@ static void functionfs_cleanup(void)

	pr_info("unloading\n");
	unregister_filesystem(&ffs_fs_type);

	if (ffs_ipc_log) {
		ipc_log_context_destroy(ffs_ipc_log);
		ffs_ipc_log = NULL;
	}
}