shell: fix history memory reclaim
No ring_buf_get_finish() should be performed on ring_buf memory that wasn't claimed beforehand. Using ring_buf_get() with a NULL destination does both the claim and the finish part without retrieving anything. This is especially important with the ring_buffer revanp where the above is enforced for proper operation. Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
This commit is contained in:
parent
4635c0866f
commit
24f5c65b5a
1 changed files with 1 additions and 1 deletions
|
@ -116,7 +116,7 @@ static bool remove_from_tail(struct shell_history *history)
|
|||
|
||||
total_len = offsetof(struct shell_history_item, data) +
|
||||
h_item->len + h_item->padding;
|
||||
ring_buf_get_finish(history->ring_buf, total_len);
|
||||
ring_buf_get(history->ring_buf, NULL, total_len);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue