projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fc4fb28
)
printk: Fix log_buf_copy termination.
author
Arve Hjønnevåg
<arve@android.com>
Tue, 15 Apr 2008 04:35:25 +0000
(21:35 -0700)
committer
Colin Cross
<ccross@android.com>
Tue, 14 Jun 2011 16:09:14 +0000
(09:09 -0700)
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.
kernel/printk.c
patch
|
blob
|
history
diff --git
a/kernel/printk.c
b/kernel/printk.c
index c78ed88446d6c2febb2c8616b67fc63baff10fa4..cd8fbf3440a88d5a53bc88964a93cd7ac974f491 100644
(file)
--- a/
kernel/printk.c
+++ b/
kernel/printk.c
@@
-319,8
+319,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)