diff options
author | Kay Sievers <kay@vrfy.org> | 2013-03-16 18:41:06 +0100 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2013-03-16 18:41:06 +0100 |
commit | 73ebda564ccdfd9242c6910f911b21432dd9cdff (patch) | |
tree | 436176cb7865d1b9cec1354bfac36521f542ae6c | |
parent | fc1e8f352c4881287b2a6bf039b6d0914a02f9f6 (diff) |
setup: if all BootXXXX are used, find the next slot behind, don't overwrite Boot0000
https://bbs.archlinux.org/viewtopic.php?pid=1242470#p1242470
-rw-r--r-- | src/setup/setup.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/setup/setup.c b/src/setup/setup.c index 962126c..c9249ee 100644 --- a/src/setup/setup.c +++ b/src/setup/setup.c @@ -900,6 +900,11 @@ static int find_slot(const uint8_t uuid[16], const char *path, uint16_t *id) { goto finish; } + /* use the next one */ + if (i == 0xffff) + return -ENOSPC; + new_id = i; + finish: *id = new_id; free(options); |