Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Sep 2017 07:29:26 +0000 (UTC)
From:      Toomas Soome <tsoome@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r323905 - in head/sys/boot/efi: include loader
Message-ID:  <201709220729.v8M7TQmO001190@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tsoome
Date: Fri Sep 22 07:29:26 2017
New Revision: 323905
URL: https://svnweb.freebsd.org/changeset/base/323905

Log:
  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.

Modified:
  head/sys/boot/efi/include/efilib.h
  head/sys/boot/efi/loader/main.c

Modified: head/sys/boot/efi/include/efilib.h
==============================================================================
--- head/sys/boot/efi/include/efilib.h	Fri Sep 22 06:33:01 2017	(r323904)
+++ head/sys/boot/efi/include/efilib.h	Fri Sep 22 07:29:26 2017	(r323905)
@@ -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;
 

Modified: head/sys/boot/efi/loader/main.c
==============================================================================
--- head/sys/boot/efi/loader/main.c	Fri Sep 22 06:33:01 2017	(r323904)
+++ head/sys/boot/efi/loader/main.c	Fri Sep 22 07:29:26 2017	(r323905)
@@ -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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201709220729.v8M7TQmO001190>