From 73ebda564ccdfd9242c6910f911b21432dd9cdff Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Sat, 16 Mar 2013 18:41:06 +0100 Subject: [PATCH] setup: if all BootXXXX are used, find the next slot behind, don't overwrite Boot0000 https://bbs.archlinux.org/viewtopic.php?pid=1242470#p1242470 --- src/setup/setup.c | 5 +++++ 1 file changed, 5 insertions(+) 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); -- 2.7.4