summaryrefslogtreecommitdiff
path: root/target/linux/goldfish/patches-2.6.30/0110-printk-Fix-log_buf_copy-termination.patch
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2009-06-14 20:42:33 +0000
committerFelix Fietkau <nbd@openwrt.org>2009-06-14 20:42:33 +0000
commitf88360279f91387dc61725226ad38c3c95d3790a (patch)
tree66d21f3483914eb7e674c45f3497ab8912094ac0 /target/linux/goldfish/patches-2.6.30/0110-printk-Fix-log_buf_copy-termination.patch
parenta6d8f8be9e06c5ffb03f815c8c76ba743c64aa3d (diff)
downloadmtk-20170518-f88360279f91387dc61725226ad38c3c95d3790a.zip
mtk-20170518-f88360279f91387dc61725226ad38c3c95d3790a.tar.gz
mtk-20170518-f88360279f91387dc61725226ad38c3c95d3790a.tar.bz2
add the 'goldfish' target, useful for experimenting with virtual phone hardware (includes the emulator)
SVN-Revision: 16459
Diffstat (limited to 'target/linux/goldfish/patches-2.6.30/0110-printk-Fix-log_buf_copy-termination.patch')
-rw-r--r--target/linux/goldfish/patches-2.6.30/0110-printk-Fix-log_buf_copy-termination.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/target/linux/goldfish/patches-2.6.30/0110-printk-Fix-log_buf_copy-termination.patch b/target/linux/goldfish/patches-2.6.30/0110-printk-Fix-log_buf_copy-termination.patch
new file mode 100644
index 0000000..3956090
--- /dev/null
+++ b/target/linux/goldfish/patches-2.6.30/0110-printk-Fix-log_buf_copy-termination.patch
@@ -0,0 +1,24 @@
+From e500cd364086cfc018b100d08c97b2fdf229d029 Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= <arve@android.com>
+Date: Mon, 14 Apr 2008 21:35:25 -0700
+Subject: [PATCH 110/134] 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.
+---
+ kernel/printk.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+--- a/kernel/printk.c
++++ b/kernel/printk.c
+@@ -279,8 +279,8 @@ int log_buf_copy(char *dest, int idx, in
+ 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)