projects
/
profile
/
extras
/
intel-gpu-tools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
53ad1e4
)
tests/gem_reset_stats: fix length check in inject_hang
author
Mika Kuoppala
<mika.kuoppala@intel.com>
Thu, 10 Apr 2014 14:51:39 +0000
(17:51 +0300)
committer
Mika Kuoppala
<mika.kuoppala@intel.com>
Thu, 10 Apr 2014 14:53:08 +0000
(17:53 +0300)
To avoid writing past the batch end.
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
tests/gem_reset_stats.c
patch
|
blob
|
history
diff --git
a/tests/gem_reset_stats.c
b/tests/gem_reset_stats.c
index
c69059b
..
c227798
100644
(file)
--- a/
tests/gem_reset_stats.c
+++ b/
tests/gem_reset_stats.c
@@
-295,7
+295,7
@@
static int inject_hang_ring(int fd, int ctx, int ring, bool ignore_ban_error)
for (i = 0; i < ITEMS; i++)
buf[i] = MI_NOOP;
- roff = random() % (ITEMS - cmd_len);
+ roff = random() % (ITEMS - cmd_len
- 1
);
buf[roff] = MI_BATCH_BUFFER_START | (cmd_len - 2);
buf[roff + 1] = (gtt_off & 0xfffffffc) + (roff << 2);
if (cmd_len == 3)