[PATCH] fix memory scribble in arch/i386/pci/fixup.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 17 May 2005, Sy, Dely L wrote:

> On Friday, May 13, 2005 3:36 PM, Greg KH wrote:
> > > The definition of GET_INDEX is suspect:
> > > 
> > > #define GET_INDEX(a, b) (((a - PCI_DEVICE_ID_INTEL_MCH_PA) << 3) + b)
> > > should this not be
> > > #define GET_INDEX(a, b) ((((a) - PCI_DEVICE_ID_INTEL_MCH_PA) << 3) + \
> > > 				((b) & 7))
> > Dely, any thoughts about this, or know who would know about it?
> 
> I looked at the code and talked with Steve on this.  The fix is correct;
> i.e. b has to be masked with 7.  Would Christoph or you send out a 
> patch for the fix or would you like us to do so?  Thanks for finding out
> the problem.

Ok. Here is the patch:

Index: linux-2.6.12-rc4/arch/i386/pci/fixup.c
===================================================================
--- linux-2.6.12-rc4.orig/arch/i386/pci/fixup.c	2005-05-12 16:39:39.000000000 +0000
+++ linux-2.6.12-rc4/arch/i386/pci/fixup.c	2005-05-17 15:45:05.000000000 +0000
@@ -253,7 +253,7 @@
 #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)
 {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux