Commit 63ab387ca0d1576edef35ef68e4b8ea5e0757b7a

Authored by Myron Stowe
Committed by Jesse Barnes
1 parent 6748dcc269

x86/PCI: add spinlock held check to 'pcibios_fwaddrmap_lookup()'

'pcibios_fwaddrmap_lookup()' is used to maintain FW-assigned BIOS BAR
values for reinstatement when normal resource assignment attempts
fail and must be called with the 'pcibios_fwaddrmap_lock' spinlock
held.

This patch adds a WARN_ON notification if the spinlock is not currently
held by the caller.

Signed-off-by: Myron Stowe <myron.stowe@redhat.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>

Showing 1 changed file with 2 additions and 0 deletions Side-by-side Diff

... ... @@ -57,6 +57,8 @@
57 57 {
58 58 struct pcibios_fwaddrmap *map;
59 59  
  60 + WARN_ON(!spin_is_locked(&pcibios_fwaddrmap_lock));
  61 +
60 62 list_for_each_entry(map, &pcibios_fwaddrmappings, list)
61 63 if (map->dev == dev)
62 64 return map;