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 67e3663fc9)

Change-Id: Ia7b337e1fab6e334729f47ee1269e6c736615177
This commit is contained in:
Colin Cross 2013-06-17 16:20:08 -07:00
parent 8196316411
commit 5e484e9c43
1 changed files with 3 additions and 1 deletions

View File

@ -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);
}