Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Jan 2011 01:11:07 +0000 (UTC)
From:      Lawrence Stewart <lstewart@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r217250 - head/sys/kern
Message-ID:  <201101110111.p0B1B7WJ001499@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: lstewart
Date: Tue Jan 11 01:11:07 2011
New Revision: 217250
URL: http://svn.freebsd.org/changeset/base/217250

Log:
  Fix hhook_head_is_virtualised() so that "ret" can't be used uninitialised.
  
  Sponsored by:	FreeBSD Foundation
  Submitted by:	pjd
  MFC after:	9 weeks
  X-MFC with:	r216615

Modified:
  head/sys/kern/kern_hhook.c

Modified: head/sys/kern/kern_hhook.c
==============================================================================
--- head/sys/kern/kern_hhook.c	Tue Jan 11 00:58:49 2011	(r217249)
+++ head/sys/kern/kern_hhook.c	Tue Jan 11 01:11:07 2011	(r217250)
@@ -380,11 +380,12 @@ hhook_head_is_virtualised(struct hhook_h
 {
 	uint32_t ret;
 
-	if (hhh == NULL)
-		return (0);
+	ret = 0;
 
-	if (hhh->hhh_flags & HHH_ISINVNET)
-		ret = HHOOK_HEADISINVNET;
+	if (hhh != NULL) {
+		if (hhh->hhh_flags & HHH_ISINVNET)
+			ret = HHOOK_HEADISINVNET;
+	}
 
 	return (ret);
 }



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