|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v2 4/7] xen/device-tree: Fix bootfdt.c to tolerate 0 reserved regions
(+ Stefano) Hi Shawn, On 15/12/2023 02:43, Shawn Anastasio wrote: The early_print_info routine in bootfdt.c incorrectly stores the result of a call to fdt_num_mem_rsv() in an unsigned int, which results in the negative error code being interpreted incorrectly in a subsequent loop in the case where the device tree does not contain any memory reserve map entries. I have some trouble to reconciliate the code with your explanation. Looking at the implementation fdt_num_mem_rsv() should return 0 if there are no reserved regions. A negative value would only be returned if the device-tree is malformated. Do you have a Device-Tree where the issue occurs? That said, I agree that the code could be hardened.
If I am correct above, then I think we should panic() rather than trying to continue with a buggy DT. Cheers, -- Julien Grall
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |