summaryrefslogtreecommitdiff
path: root/arch/powerpc/oprofile/op_model_cell.c
diff options
context:
space:
mode:
authorDenis Kirjanov <dkirjanov@hera.kernel.org>2010-06-01 15:43:34 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-07-05 11:08:43 -0700
commit43bee391355ad45021579511963dfb46d6e810fb (patch)
treefdc9b86962b58be210903405be629406a8cd3fa4 /arch/powerpc/oprofile/op_model_cell.c
parent21dfd35afeaf03c5fe4409d1021b2cc888c11326 (diff)
powerpc/oprofile: fix potential buffer overrun in op_model_cell.c
commit 238c1a78c957f3dc7cb848b161dcf4805793ed56 upstream. Fix potential initial_lfsr buffer overrun. Writing past the end of the buffer could happen when index == ENTRIES Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org> Signed-off-by: Robert Richter <robert.richter@amd.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/powerpc/oprofile/op_model_cell.c')
-rw-r--r--arch/powerpc/oprofile/op_model_cell.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/oprofile/op_model_cell.c b/arch/powerpc/oprofile/op_model_cell.c
index 5ff4de3eb3be..303721d70869 100644
--- a/arch/powerpc/oprofile/op_model_cell.c
+++ b/arch/powerpc/oprofile/op_model_cell.c
@@ -821,7 +821,7 @@ static int calculate_lfsr(int n)
index = ENTRIES-1;
/* make sure index is valid */
- if ((index > ENTRIES) || (index < 0))
+ if ((index >= ENTRIES) || (index < 0))
index = ENTRIES-1;
return initial_lfsr[index];