diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2014-10-29 14:15:00 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@linaro.org> | 2014-11-04 11:43:09 -0500 |
commit | 50ba08f301a1b0310775deeed00c9b24ba75fe8a (patch) | |
tree | c1bae1ae585a16bde52d2901f952507fe452cee3 /drivers/of | |
parent | b75b276bead4850c86e60747babe09be5c13d4d1 (diff) |
of/fdt: Don't clear initial_boot_params if fdt_check_header() fails
If the device tree pointer is NULL, early_init_dt_verify() fails, leaving
initial_boot_params unchanged. If the device tree pointer is non-NULL but
invalid, early_init_dt_verify() again fails but this time it also clears
initial_boot_params.
Leave initial_boot_params unchanged if the device tree pointer is invalid.
This doesn't fix a bug, but it makes the behavior more consistent and
easier to analyze.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
Diffstat (limited to 'drivers/of')
-rw-r--r-- | drivers/of/fdt.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 1d30b9f96466..535124670257 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c | |||
@@ -992,15 +992,12 @@ bool __init early_init_dt_verify(void *params) | |||
992 | if (!params) | 992 | if (!params) |
993 | return false; | 993 | return false; |
994 | 994 | ||
995 | /* Setup flat device-tree pointer */ | ||
996 | initial_boot_params = params; | ||
997 | |||
998 | /* check device tree validity */ | 995 | /* check device tree validity */ |
999 | if (fdt_check_header(params)) { | 996 | if (fdt_check_header(params)) |
1000 | initial_boot_params = NULL; | ||
1001 | return false; | 997 | return false; |
1002 | } | ||
1003 | 998 | ||
999 | /* Setup flat device-tree pointer */ | ||
1000 | initial_boot_params = params; | ||
1004 | return true; | 1001 | return true; |
1005 | } | 1002 | } |
1006 | 1003 | ||