summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2013-03-16 18:41:06 +0100
committerKay Sievers <kay@vrfy.org>2013-03-16 18:41:06 +0100
commit73ebda564ccdfd9242c6910f911b21432dd9cdff (patch)
tree436176cb7865d1b9cec1354bfac36521f542ae6c
parentfc1e8f352c4881287b2a6bf039b6d0914a02f9f6 (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.c5
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);