Commit 2227f27
rtla/actions: Fix condition for buffer reallocation
The condition to check if the actions buffer needs to be resized was
incorrect. The check `self->size >= self->len` would evaluate to
true on almost every call to `actions_new()`, causing the buffer to
be reallocated unnecessarily each time an action was added.
Fix the condition to `self->len >= self.size`, ensuring
that the buffer is only resized when it is actually full.
Cc: John Kacur <[email protected]>
Cc: Luis Goncalves <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Chang Yin <[email protected]>
Cc: Costa Shulyupin <[email protected]>
Cc: Crystal Wood <[email protected]>
Cc: Gabriele Monaco <[email protected]>
Link: https://lore.kernel.org/[email protected]
Fixes: 6ea082b ("rtla/timerlat: Add action on threshold feature")
Signed-off-by: Wander Lairson Costa <[email protected]>
Reviewed-by: Tomas Glozar <[email protected]>
Signed-off-by: Steven Rostedt (Google) <[email protected]>1 parent b1e0ff7 commit 2227f27
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
0 commit comments