diff options
author | Barry Spinney <spinney@mellanox.com> | 2016-06-03 18:49:02 -0400 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2016-06-06 09:32:39 +0300 |
commit | 77c9a2d45436b8c157955806bc6cdbb26e63afbc (patch) | |
tree | 1401bd2e4df846deeb82f724d87dcbd19ee3f6a0 /platform/linux-generic/odp_timer_wheel.c | |
parent | d9f145d4e66ce65872667b05691b29712276e241 (diff) |
linux-generic: tm: fix an off by one error
The loop used to chop up and link together a large malloc'd memory block
into many smaller timer_blk records looped once too many times.
Signed-off-by: Barry Spinney <spinney@mellanox.com>
Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'platform/linux-generic/odp_timer_wheel.c')
-rw-r--r-- | platform/linux-generic/odp_timer_wheel.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/platform/linux-generic/odp_timer_wheel.c b/platform/linux-generic/odp_timer_wheel.c index ca2a3e4e5..865dd7ed6 100644 --- a/platform/linux-generic/odp_timer_wheel.c +++ b/platform/linux-generic/odp_timer_wheel.c @@ -308,7 +308,7 @@ static int free_list_add(timer_wheels_t *timer_wheels, /* Link these timer_blks together. */ timer_blk = block_of_timer_blks; next_timer_blk = timer_blk + 1; - for (idx = 0; idx < num_timer_blks; idx++) { + for (idx = 0; idx < num_timer_blks - 1; idx++) { timer_blk->next_timer_blk = next_timer_blk; timer_blk = next_timer_blk; next_timer_blk++; |