aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@FreeBSD.org>2017-09-22 07:29:26 +0000
committerToomas Soome <tsoome@FreeBSD.org>2017-09-22 07:29:26 +0000
commitb07d6aa2ae866ad8aa7643c1bd3354daa4c948da (patch)
tree53a50c2095acf37f43e8661d36b036e23e8e7293
parentd28a3a393b41546694c6927a2546770839ae841f (diff)
libefi: pdinfo_t pd_unit and pd_open should be unsigned
The device index, partition index and reference counter are all positive numbers. However, since our internal partition number may be negative to indicate GPT table, the compare expression need to take care when comparing pdinfo_t and partition data.
Notes
Notes: svn path=/head/; revision=323905
-rw-r--r--sys/boot/efi/include/efilib.h4
-rw-r--r--sys/boot/efi/loader/main.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/sys/boot/efi/include/efilib.h b/sys/boot/efi/include/efilib.h
index cd8ab373a781..ff88bc70454c 100644
--- a/sys/boot/efi/include/efilib.h
+++ b/sys/boot/efi/include/efilib.h
@@ -56,8 +56,8 @@ typedef struct pdinfo
EFI_HANDLE pd_alias;
EFI_DEVICE_PATH *pd_devpath;
EFI_BLOCK_IO *pd_blkio;
- int pd_unit; /* unit number */
- int pd_open; /* reference counter */
+ uint32_t pd_unit; /* unit number */
+ uint32_t pd_open; /* reference counter */
void *pd_bcache; /* buffer cache data */
} pdinfo_t;
diff --git a/sys/boot/efi/loader/main.c b/sys/boot/efi/loader/main.c
index 8ebfab4490e5..17e2f70db4ba 100644
--- a/sys/boot/efi/loader/main.c
+++ b/sys/boot/efi/loader/main.c
@@ -901,7 +901,7 @@ command_chain(int argc, char *argv[])
/*
* d_partition should be 255
*/
- if (pd->pd_unit == d_dev->d_slice) {
+ if (pd->pd_unit == (uint32_t)d_dev->d_slice) {
loaded_image->DeviceHandle =
pd->pd_handle;
break;