summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2013-06-17 16:20:08 -0700
committerColin Cross <ccross@android.com>2013-06-17 16:58:14 -0700
commit5e484e9c439f8c065270209f32bdbfb731729250 (patch)
tree69b7713262ba10a7e7076813ecdf55b2539b5f89 /init
parent81963164113f98f5917c7d7990ae2b76f2d4044e (diff)
downloadsystem_core-5e484e9c439f8c065270209f32bdbfb731729250.zip
system_core-5e484e9c439f8c065270209f32bdbfb731729250.tar.gz
system_core-5e484e9c439f8c065270209f32bdbfb731729250.tar.bz2
init: fix copying boot properties
The previous patch "init: verify size of property buffers passed to property_get" incorrectly modified one of the callers, resulting in ro.serialno, ro.bootmode, ro.baseband, and ro.bootloader always being set to their default values. Bug: 9469860 (cherry picked from commit 67e3663fc93c65b69b5d121db05b0833b98d97f1) Change-Id: Ia7b337e1fab6e334729f47ee1269e6c736615177
Diffstat (limited to 'init')
-rwxr-xr-xinit/init.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/init/init.c b/init/init.c
index 1647078..afa4d44 100755
--- a/init/init.c
+++ b/init/init.c
@@ -640,7 +640,9 @@ static void export_kernel_boot_props(void)
for (i = 0; i < ARRAY_SIZE(prop_map); i++) {
ret = property_get(prop_map[i].src_prop, tmp);
- if (ret == 0)
+ if (ret > 0)
+ property_set(prop_map[i].dest_prop, tmp);
+ else
property_set(prop_map[i].dest_prop, prop_map[i].def_val);
}