Commit a931dd33 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull module updates from Jessica Yu:

 - Fix incorrect logic in module_kallsyms_on_each_symbol()

 - Fix for a Coccinelle warning

* tag 'modules-for-v5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux:
  module: correctly exit module_kallsyms_on_each_symbol when fn() != 0
  kernel/module: Use BUG_ON instead of if condition followed by BUG
parents 1423e266 2c0f0f36
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1018,8 +1018,7 @@ void __symbol_put(const char *symbol)
	};

	preempt_disable();
	if (!find_symbol(&fsa))
		BUG();
	BUG_ON(!find_symbol(&fsa));
	module_put(fsa.owner);
	preempt_enable();
}
@@ -4425,9 +4424,10 @@ int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *,
			ret = fn(data, kallsyms_symbol_name(kallsyms, i),
				 mod, kallsyms_symbol_value(sym));
			if (ret != 0)
				break;
				goto out;
		}
	}
out:
	mutex_unlock(&module_mutex);
	return ret;
}