image-fdt: boot_get_fdt() return value when no DTB exists
PATCH 1/1 image-fdt: boot_get_fdt() return value when no DTB exists
From: Noam Camus <[email protected]>
I believe that when no DTB is around we should return 1. This why I fixed such scenarious to not return zero anymore. Else kernel might get NULL pointer to DTB which doesn't exists.
--- common/image-fdt.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
common/image-fdt.c +2 -2
@@ -413,11 +413,11 @@ int boot_get_fdt(int flag, int argc, char * const argv[], uint8_t arch, } }else {debug ("## No Flattened Device Tree\n" ); -return 0 ; + goto error; } }else {debug ("## No Flattened Device Tree\n" ); -return 0 ; + goto error; } *of_flat_tree = fdt_blob;
Signature · 1 line
1.7.1
PATCH 1/1 image-fdt: boot_get_fdt() return value when no DTB exists
Quoted 7 lines · Noam Camus
From: Noam Camus <[email protected]>
I believe that when no DTB is around we should return 1. This why I fixed such scenarious to not return zero anymore. Else kernel might get NULL pointer to DTB which doesn't exists.
Signed-off-by Noam Camus <[email protected]>
While this is probably OK and not an issue, my only "what if" is, what about for appened device trees?
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141022/3e09d660/attachment.pgp>
PATCH 1/1 image-fdt: boot_get_fdt() return value when no DTB exists
Hi Tom,
Quoted 4 lines · Tom Rini
Quoted 2 lines · Noam Camus
From: Noam Camus <[email protected]>
Quoted 8 lines
Quoted 5 lines
I believe that when no DTB is around we should return 1. This why I fixed such scenarious to not return zero anymore. Else kernel might get NULL pointer to DTB which doesn't exists.
Signed-off-by Noam Camus <[email protected]>While this is probably OK and not an issue, my only "what if" is, what about for appened device trees?
Which device tree do you mean?
The one built in uImage or in FIT image?
-Alexey
PATCH 1/1 image-fdt: boot_get_fdt() return value when no DTB exists
Quoted 11 lines · Alexey Brodkin
Hi Tom,
Quoted 8 lines · Tom Rini
Quoted 6 lines · Noam Camus
From: Noam Camus <[email protected]>
I believe that when no DTB is around we should return 1. This why I fixed such scenarious to not return zero anymore. Else kernel might get NULL pointer to DTB which doesn't exists.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Noam Camus <[email protected]>While this is probably OK and not an issue, my only "what if" is, what about for appened device trees?
Which device tree do you mean?
The one built in uImage or in FIT image?
I'm talking about the allowed-by-kludgey case of a device tree being cat'd to the end of an image prior to loading.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141022/4ad80789/attachment.pgp>
Quoted 7 lines · Noam Camus
From: Noam Camus <[email protected]>
I believe that when no DTB is around we should return 1. This why I fixed such scenarious to not return zero anymore. Else kernel might get NULL pointer to DTB which doesn't exists.
Signed-off-by Noam Camus <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141110/8b1bb502/attachment.pgp>
Quoted 7 lines · Noam Camus
From: Noam Camus <[email protected]>
I believe that when no DTB is around we should return 1. This why I fixed such scenarious to not return zero anymore. Else kernel might get NULL pointer to DTB which doesn't exists.
Signed-off-by Noam Camus <[email protected]>
It has been found that this change breaks the case of an appended device tree file, so for the problem in question some other solution must be found.
This reverts commit c6150aaf2f2745141a7c2ceded58d7efbfeace7d.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141203/0544273a/attachment.pgp>