forked from Mirrors/opensbi
platform: generic: Terminate platform.name with null
fw_platform_init() fills platform.name without considering the ending null character. Fix it. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
This commit is contained in:
@@ -85,7 +85,7 @@ unsigned long fw_platform_init(unsigned long arg0, unsigned long arg1,
|
|||||||
|
|
||||||
model = fdt_getprop(fdt, root_offset, "model", &len);
|
model = fdt_getprop(fdt, root_offset, "model", &len);
|
||||||
if (model)
|
if (model)
|
||||||
sbi_strncpy(platform.name, model, sizeof(platform.name));
|
sbi_strncpy(platform.name, model, sizeof(platform.name) - 1);
|
||||||
|
|
||||||
if (generic_plat && generic_plat->features)
|
if (generic_plat && generic_plat->features)
|
||||||
platform.features = generic_plat->features(generic_plat_match);
|
platform.features = generic_plat->features(generic_plat_match);
|
||||||
|
Reference in New Issue
Block a user