system/corennnnn
修訂 | 21c5d3112e0df3e30354f0cc49195d2e52ea9da2 (tree) |
---|---|
時間 | 2016-11-09 00:24:23 |
作者 | 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>
@@ -260,11 +260,11 @@ config_mbr(struct disk_info *dinfo) | ||
260 | 260 | } |
261 | 261 | |
262 | 262 | /* if extended, need 1 lba for ebr */ |
263 | - if ((cur_lba + extended) >= dinfo->num_lba) | |
263 | + if (dinfo->num_lba && (cur_lba + extended) >= dinfo->num_lba) | |
264 | 264 | goto nospace; |
265 | 265 | else if (pinfo->len_kb != (uint32_t)-1) { |
266 | 266 | uint32_t sz_lba = (pinfo->len_kb / dinfo->sect_size) * 1024; |
267 | - if ((cur_lba + sz_lba + extended) > dinfo->num_lba) | |
267 | + if (dinfo->num_lba && (cur_lba + sz_lba + extended) > dinfo->num_lba) | |
268 | 268 | goto nospace; |
269 | 269 | } |
270 | 270 |