Matt Fleming f464246d85 efivars: only check for duplicates on the registered list
variable_is_present() accesses '__efivars' directly, but when called via
gsmi_init() Michel reports observing the following crash,

  BUG: unable to handle kernel NULL pointer dereference at (null)
  IP: variable_is_present+0x55/0x170
  Call Trace:
    register_efivars+0x106/0x370
    gsmi_init+0x2ad/0x3da
    do_one_initcall+0x3f/0x170

The reason for the crash is that '__efivars' hasn't been initialised nor
has it been registered with register_efivars() by the time the google
EFI SMI driver runs.  The gsmi code uses its own struct efivars, and
therefore, a different variable list.  Fix the above crash by passing
the registered struct efivars to variable_is_present(), so that we
traverse the correct list.

Reported-by: Michel Lespinasse <walken@google.com>
Tested-by: Michel Lespinasse <walken@google.com>
Cc: Mike Waychison <mikew@google.com>
Cc: Matthew Garrett <matthew.garrett@nebula.com>
Cc: Seiji Aguchi <seiji.aguchi@hds.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-04-26 08:02:03 -07:00
..
2013-04-05 19:29:36 -07:00
2013-04-09 18:03:25 +01:00
2013-02-21 15:27:22 -08:00
2013-04-05 21:02:17 +08:00
2013-02-27 19:10:15 -08:00
2013-02-27 19:10:15 -08:00
2013-03-01 13:39:00 -08:00
2013-03-27 09:25:11 -07:00
2013-04-19 17:57:48 -04:00
2013-02-27 19:10:18 -08:00
2013-02-26 09:34:29 -08:00
2013-04-07 15:11:27 +03:00
2013-02-27 19:10:18 -08:00
2013-04-05 10:04:41 -07:00
2013-04-26 07:59:23 -07:00
2013-02-27 19:10:19 -08:00
2013-04-10 15:57:33 -07:00
2013-02-22 23:31:31 -05:00
2013-02-21 13:57:13 -08:00