lkml.org 
[lkml]   [2012]   [Oct]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] edac: fix buffer overrun if no suitable bandwidth found
Date
fix buffer overrun if no suitable bandwidth found

Signed-off-by: Denis Kirjanov <kirjanov@gmail.com>
---
drivers/edac/amd64_edac.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index 5a297a2..d85ad9e 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -188,6 +188,9 @@ static int __amd64_set_scrub_rate(struct pci_dev *ctl, u32 new_bw, u32 min_rate)
* scrubrates array.
*/
}
+ if (i == ARRAY_SIZE(scrubrates)) {
+ i--;
+ }

scrubval = scrubrates[i].scrubval;

--
1.7.9.5


\
 
 \ /
  Last update: 2012-10-22 18:21    [W:0.107 / U:0.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site