Commit 63ab387c authored by Myron Stowe's avatar Myron Stowe Committed by Jesse Barnes
Browse files

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: default avatarMyron Stowe <myron.stowe@redhat.com>
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent 6748dcc2
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -57,6 +57,8 @@ static struct pcibios_fwaddrmap *pcibios_fwaddrmap_lookup(struct pci_dev *dev)
{
{
	struct pcibios_fwaddrmap *map;
	struct pcibios_fwaddrmap *map;


	WARN_ON(!spin_is_locked(&pcibios_fwaddrmap_lock));

	list_for_each_entry(map, &pcibios_fwaddrmappings, list)
	list_for_each_entry(map, &pcibios_fwaddrmappings, list)
		if (map->dev == dev)
		if (map->dev == dev)
			return map;
			return map;