Single overzealous locking assertion fix.

Cheers,
 Rusty.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJVvtamAAoJENkgDmzRrbjxGjcQAIpU+NggGTh8Duangp43e8Qp
 YJq0aO6biyVn6gXynlQ+7nl98nxFzaYkluUvaTbED3OP2uD+XQe1BGFiuAGX1JhR
 O4Trn5+0NU2O0DJdda4dxnIBa+OgB8Z3TSxxEt1YImFbpUvckk81isuwl1x2ORLs
 ypX+JrQo5nQRXkhjV4Jg74CB0spHeMUcGbTVsp0S5iX2r+bZw4H4qgQvvkUChX8d
 zb9ej96b8wpdNYBW5AB7kcf1gcLGSRqvenpAseAzGmUVqr1SGgCsNLUwEgLvCgwB
 JyABdaXz51mopap7Q3CRbU8LWnVHp+Ft0ebJ8cOOsr9hQ0O44vg8dBdCza/jcjyA
 C9s1gP3v0BTBd71dwsuWlw3DfB+gMX5GP3qtdcBe5ULs3hBYnO8xvr+w41+GJcFQ
 vt3tiu6ljfRceGI8mBHy8/lDbmWVYnm4L1w27NNi+CSZzSy5uONyl/9PWz4L1EKM
 o4gV23jnnza254vnpKQ5am8DKIo8I0MxHca7wzO+M3+kJ6Sjfd0CnySuMulwpYD7
 CimVnxKyc+x7hK/nXTA1UrBYJbJ3i0xxsfQmNBY6HG322rXnBXXcz76G905S0FJ+
 /9ru913zuZkNZWXNz9KBk5+724nW0eqm3f0iWebHWxUsjtF/KZ8rMskSvRUvxdEV
 mDw3H05X4viTmyNqH9Sy
 =L1VK
 -----END PGP SIGNATURE-----

Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux

Pull module fix from Rusty Russell:
 "Single overzealous locking assertion fix"

* tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
  module: weaken locking assertion for oops path.
This commit is contained in:
Linus Torvalds 2015-08-03 10:25:32 -07:00
commit 5b2a0eeea7

View File

@ -602,13 +602,16 @@ const struct kernel_symbol *find_symbol(const char *name,
} }
EXPORT_SYMBOL_GPL(find_symbol); EXPORT_SYMBOL_GPL(find_symbol);
/* Search for module by name: must hold module_mutex. */ /*
* Search for module by name: must hold module_mutex (or preempt disabled
* for read-only access).
*/
static struct module *find_module_all(const char *name, size_t len, static struct module *find_module_all(const char *name, size_t len,
bool even_unformed) bool even_unformed)
{ {
struct module *mod; struct module *mod;
module_assert_mutex(); module_assert_mutex_or_preempt();
list_for_each_entry(mod, &modules, list) { list_for_each_entry(mod, &modules, list) {
if (!even_unformed && mod->state == MODULE_STATE_UNFORMED) if (!even_unformed && mod->state == MODULE_STATE_UNFORMED)
@ -621,6 +624,7 @@ static struct module *find_module_all(const char *name, size_t len,
struct module *find_module(const char *name) struct module *find_module(const char *name)
{ {
module_assert_mutex();
return find_module_all(name, strlen(name), false); return find_module_all(name, strlen(name), false);
} }
EXPORT_SYMBOL_GPL(find_module); EXPORT_SYMBOL_GPL(find_module);