Changeset 80eaf45 in rtems
- Timestamp:
- 07/09/18 04:50:38 (5 years ago)
- Branches:
- 5, master
- Children:
- 2af004e
- Parents:
- 4fd05d3
- git-author:
- David Gibson <david@…> (07/09/18 04:50:38)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (07/19/18 05:01:12)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/dtc/libfdt/fdt_sw.c
r4fd05d3 r80eaf45 144 144 int fdt_create(void *buf, int bufsize) 145 145 { 146 const size_t hdrsize = FDT_ALIGN(sizeof(struct fdt_header), 147 sizeof(struct fdt_reserve_entry)); 146 148 void *fdt = buf; 147 149 148 if (bufsize < sizeof(struct fdt_header))150 if (bufsize < hdrsize) 149 151 return -FDT_ERR_NOSPACE; 150 152 … … 156 158 fdt_set_totalsize(fdt, bufsize); 157 159 158 fdt_set_off_mem_rsvmap(fdt, FDT_ALIGN(sizeof(struct fdt_header), 159 sizeof(struct fdt_reserve_entry))); 160 fdt_set_off_mem_rsvmap(fdt, hdrsize); 160 161 fdt_set_off_dt_struct(fdt, fdt_off_mem_rsvmap(fdt)); 161 162 fdt_set_off_dt_strings(fdt, 0); … … 173 174 headsize = fdt_off_dt_struct(fdt) + fdt_size_dt_struct(fdt); 174 175 tailsize = fdt_size_dt_strings(fdt); 176 177 if ((headsize + tailsize) > fdt_totalsize(fdt)) 178 return -FDT_ERR_INTERNAL; 175 179 176 180 if ((headsize + tailsize) > bufsize)
Note: See TracChangeset
for help on using the changeset viewer.