Skip to content

Commit

Permalink
[PATCH] fix memory scribble in arch/i386/pci/fixup.c
Browse files Browse the repository at this point in the history
The GET_INDEX() macro should use just the low three bits of the devfn,
otherwise we have a memory scribble in pcie_rootport_aspm_quirk that
overwrites ptype_all

Fix it to be more careful about its arguments while at it.

Acked by Dely Sy <[email protected]>

Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
clameter authored and Linus Torvalds committed May 17, 2005
1 parent 8c41a5f commit ff0d2f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/i386/pci/fixup.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2, pci
#define MAX_PCIEROOT 6
static int quirk_aspm_offset[MAX_PCIEROOT << 3];

#define GET_INDEX(a, b) (((a - PCI_DEVICE_ID_INTEL_MCH_PA) << 3) + b)
#define GET_INDEX(a, b) ((((a) - PCI_DEVICE_ID_INTEL_MCH_PA) << 3) + ((b) & 7))

static int quirk_pcie_aspm_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value)
{
Expand Down

0 comments on commit ff0d2f9

Please sign in to comment.