svn commit: r217067 - head/sys/boot/efi/libefi

Marcel Moolenaar marcel at FreeBSD.org
Thu Jan 6 20:50:18 UTC 2011


Author: marcel
Date: Thu Jan  6 20:50:16 2011
New Revision: 217067
URL: http://svn.freebsd.org/changeset/base/217067

Log:
  Help static analysis by initializing variables that we know cannot be
  used uninitialized, but which cannot be inferred from the code itself.

Modified:
  head/sys/boot/efi/libefi/efinet.c
  head/sys/boot/efi/libefi/efipart.c

Modified: head/sys/boot/efi/libefi/efinet.c
==============================================================================
--- head/sys/boot/efi/libefi/efinet.c	Thu Jan  6 20:31:33 2011	(r217066)
+++ head/sys/boot/efi/libefi/efinet.c	Thu Jan  6 20:50:16 2011	(r217067)
@@ -262,6 +262,7 @@ efinet_dev_init()
 	int err, i, nifs;
 
 	sz = 0;
+	handles = NULL;
 	status = BS->LocateHandle(ByProtocol, &sn_guid, 0, &sz, 0);
 	if (status == EFI_BUFFER_TOO_SMALL) {
 		handles = (EFI_HANDLE *)malloc(sz);

Modified: head/sys/boot/efi/libefi/efipart.c
==============================================================================
--- head/sys/boot/efi/libefi/efipart.c	Thu Jan  6 20:31:33 2011	(r217066)
+++ head/sys/boot/efi/libefi/efipart.c	Thu Jan  6 20:50:16 2011	(r217067)
@@ -69,6 +69,7 @@ efipart_init(void) 
 	int err;
 
 	sz = 0;
+	hin = NULL;
 	status = BS->LocateHandle(ByProtocol, &blkio_guid, 0, &sz, 0);
 	if (status == EFI_BUFFER_TOO_SMALL) {
 		hin = (EFI_HANDLE *)malloc(sz * 2);


More information about the svn-src-head mailing list