summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-01-05 15:09:43 +0900
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-01-05 12:15:24 +0100
commite37d30f334830fab4decd52ef3c17fa09b7b0d92 (patch)
tree13a7786b89391b4ba0ae7d9d034a08cff8dc4ae3 /src
parente28df39269e03d49f540ebfe6b2e507d0f26c844 (diff)
downloadsystemd-e37d30f334830fab4decd52ef3c17fa09b7b0d92.tar.gz
sd-boot: select newest kernel entry matching with the default glob pattern
This fixes a bug introduced by 0c674ce5f24a6e52561ec6520e43a1ca45d90f01. Fixes #22004.
Diffstat (limited to 'src')
-rw-r--r--src/boot/efi/boot.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c
index 2c5bd913d2..9935f2e879 100644
--- a/src/boot/efi/boot.c
+++ b/src/boot/efi/boot.c
@@ -1638,9 +1638,9 @@ static INTN config_entry_find(Config *config, const CHAR16 *needle) {
if (!needle)
return -1;
- for (UINTN i = 0; i < config->entry_count; i++)
+ for (INTN i = config->entry_count - 1; i >= 0; i--)
if (MetaiMatch(config->entries[i]->id, (CHAR16*) needle))
- return (INTN) i;
+ return i;
return -1;
}