2010-01-11 19:54:12

by Roel Kluin

[permalink] [raw]
Subject: [PATCH] amd64_edac: index not within bounds in amd64_get_scrub_rate()

Ensure index stays within bound in amd64_get_scrub_rate()

Signed-off-by: Roel Kluin <[email protected]>
---
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index c5facd9..000dc67 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -197,7 +197,7 @@ static int amd64_get_scrub_rate(struct mem_ctl_info *mci, u32 *bw)
edac_printk(KERN_DEBUG, EDAC_MC,
"pci-read, sdram scrub control value: %d \n", scrubval);

- for (i = 0; ARRAY_SIZE(scrubrates); i++) {
+ for (i = 0; i < ARRAY_SIZE(scrubrates); i++) {
if (scrubrates[i].scrubval == scrubval) {
*bw = scrubrates[i].bandwidth;
status = 0;


Subject: Re: [PATCH] amd64_edac: index not within bounds in amd64_get_scrub_rate()

On Mon, Jan 11, 2010 at 08:58:21PM +0100, Roel Kluin wrote:
> Ensure index stays within bound in amd64_get_scrub_rate()
>
> Signed-off-by: Roel Kluin <[email protected]>

Applied, thanks.

--
Regards/Gruss,
Boris.

Operating | Advanced Micro Devices GmbH
System | Karl-Hammerschmidt-Str. 34, 85609 Dornach b. M?nchen, Germany
Research | Gesch?ftsf?hrer: Andrew Bowd, Thomas M. McCoy, Giuliano Meroni
Center | Sitz: Dornach, Gemeinde Aschheim, Landkreis M?nchen
(OSRC) | Registergericht M?nchen, HRB Nr. 43632