Unverified Commit c08840de authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!13039 static_call: Handle module init failure correctly in static_call_del_module()

parents bbd75ebc af962cfc
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -405,6 +405,17 @@ static void static_call_del_module(struct module *mod)

	for (site = start; site < stop; site++) {
		key = static_call_key(site);

		/*
		 * If the key was not updated due to a memory allocation
		 * failure in __static_call_init() then treating key::sites
		 * as key::mods in the code below would cause random memory
		 * access and #GP. In that case all subsequent sites have
		 * not been touched either, so stop iterating.
		 */
		if (!static_call_key_has_mods(key))
			break;

		if (key == prev_key)
			continue;