mirror of
https://github.com/torvalds/linux.git
synced 2026-06-09 23:23:53 +02:00
printk: Fix log_buf_copy termination.
If idx was non-zero and the log had wrapped, len did not get truncated to stop at the last byte written to the log.
This commit is contained in:
parent
572b262cd3
commit
ee51cfa5c8
|
|
@ -322,8 +322,8 @@ int log_buf_copy(char *dest, int idx, int len)
|
|||
if (idx < 0 || idx >= max) {
|
||||
ret = -1;
|
||||
} else {
|
||||
if (len > max)
|
||||
len = max;
|
||||
if (len > max - idx)
|
||||
len = max - idx;
|
||||
ret = len;
|
||||
idx += (log_end - max);
|
||||
while (len-- > 0)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user