فهرست منبع

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 15 سال پیش
والد
کامیت
d709a720cd
1فایلهای تغییر یافته به همراه3 افزوده شده و 0 حذف شده
  1. 3 0
      sr_module.c

+ 3 - 0
sr_module.c

@@ -203,6 +203,9 @@ static sr31_cmd_export_t* sr_cmd_exports_convert(unsigned ver,
 		/* 3.1+ specific stuff */
 		ret[i].fixup_flags = 0;
 		ret[i].module_exports = mod;
+		/* fill known free fixups */
+		if (ret[i].fixup && ret[i].free_fixup == 0)
+			ret[i].free_fixup = get_fixup_free(ret[i].fixup);
 	}
 	return ret;
 error: