Browse code

core: automatically fill known fixup_free functions

When a module is loaded, for each fixup with a missing fixup_free
function fill the fixup_free function if known.
This way if a module uses one of the known standard fixups, the
core will fill the corresponding free fixup function even if it's
missing in the original module or the module uses a ser style
interface (that does not have a way to define free fixups).

Andrei Pelinescu-Onciul authored on 05/08/2010 21:13:12
Showing 1 changed files
... ...
@@ -203,6 +203,9 @@ static sr31_cmd_export_t* sr_cmd_exports_convert(unsigned ver,
203 203
 		/* 3.1+ specific stuff */
204 204
 		ret[i].fixup_flags = 0;
205 205
 		ret[i].module_exports = mod;
206
+		/* fill known free fixups */
207
+		if (ret[i].fixup && ret[i].free_fixup == 0)
208
+			ret[i].free_fixup = get_fixup_free(ret[i].fixup);
206 209
 	}
207 210
 	return ret;
208 211
 error: