system/core
Revision | 8016dc91cb68f9bfdb19c65bda7233eb0ae85196 (tree) |
---|---|
Time | 2019-12-17 13:15:46 |
Author | Andrew Boie <andrew.p.boie@inte...> |
Commiter | Chih-Wei Huang |
libdiskconfig: HACK Don't do space checks on zero-size images
If an image file is of zero size, assume we just want to expand it
to fit the available images.
Change-Id: If8f22eb12d3a5179960d4359307bb177e3323e8a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
@@ -259,11 +259,11 @@ config_mbr(struct disk_info *dinfo) | ||
259 | 259 | } |
260 | 260 | |
261 | 261 | /* if extended, need 1 lba for ebr */ |
262 | - if ((cur_lba + extended) >= dinfo->num_lba) | |
262 | + if (dinfo->num_lba && (cur_lba + extended) >= dinfo->num_lba) | |
263 | 263 | goto nospace; |
264 | 264 | else if (pinfo->len_kb != (uint32_t)-1) { |
265 | 265 | uint32_t sz_lba = (pinfo->len_kb / dinfo->sect_size) * 1024; |
266 | - if ((cur_lba + sz_lba + extended) > dinfo->num_lba) | |
266 | + if (dinfo->num_lba && (cur_lba + sz_lba + extended) > dinfo->num_lba) | |
267 | 267 | goto nospace; |
268 | 268 | } |
269 | 269 |