diff options
Diffstat (limited to 'drivers/of/fdt.c')
-rw-r--r-- | drivers/of/fdt.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 8b63a691a9ed..65200af29c52 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c | |||
@@ -670,7 +670,7 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname, | |||
670 | 670 | ||
671 | pr_debug("search \"chosen\", depth: %d, uname: %s\n", depth, uname); | 671 | pr_debug("search \"chosen\", depth: %d, uname: %s\n", depth, uname); |
672 | 672 | ||
673 | if (depth != 1 || | 673 | if (depth != 1 || !data || |
674 | (strcmp(uname, "chosen") != 0 && strcmp(uname, "chosen@0") != 0)) | 674 | (strcmp(uname, "chosen") != 0 && strcmp(uname, "chosen@0") != 0)) |
675 | return 0; | 675 | return 0; |
676 | 676 | ||
@@ -679,16 +679,16 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname, | |||
679 | /* Retrieve command line */ | 679 | /* Retrieve command line */ |
680 | p = of_get_flat_dt_prop(node, "bootargs", &l); | 680 | p = of_get_flat_dt_prop(node, "bootargs", &l); |
681 | if (p != NULL && l > 0) | 681 | if (p != NULL && l > 0) |
682 | strlcpy(cmd_line, p, min((int)l, COMMAND_LINE_SIZE)); | 682 | strlcpy(data, p, min((int)l, COMMAND_LINE_SIZE)); |
683 | 683 | ||
684 | #ifdef CONFIG_CMDLINE | 684 | #ifdef CONFIG_CMDLINE |
685 | #ifndef CONFIG_CMDLINE_FORCE | 685 | #ifndef CONFIG_CMDLINE_FORCE |
686 | if (p == NULL || l == 0 || (l == 1 && (*p) == 0)) | 686 | if (p == NULL || l == 0 || (l == 1 && (*p) == 0)) |
687 | #endif | 687 | #endif |
688 | strlcpy(cmd_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE); | 688 | strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE); |
689 | #endif /* CONFIG_CMDLINE */ | 689 | #endif /* CONFIG_CMDLINE */ |
690 | 690 | ||
691 | pr_debug("Command line is: %s\n", cmd_line); | 691 | pr_debug("Command line is: %s\n", (char*)data); |
692 | 692 | ||
693 | /* break now */ | 693 | /* break now */ |
694 | return 1; | 694 | return 1; |