svn commit: r279220 - head/usr.sbin/bhyve

Peter Grehan grehan at FreeBSD.org
Mon Feb 23 22:31:40 UTC 2015


Author: grehan
Date: Mon Feb 23 22:31:39 2015
New Revision: 279220
URL: https://svnweb.freebsd.org/changeset/base/279220

Log:
  Don't close a block context if it couldn't be opened,
  for example if the backing file doesn't exist,
  avoiding a null deref.
  
  Reviewed by:	neel
  MFC after:	1 week.

Modified:
  head/usr.sbin/bhyve/pci_ahci.c

Modified: head/usr.sbin/bhyve/pci_ahci.c
==============================================================================
--- head/usr.sbin/bhyve/pci_ahci.c	Mon Feb 23 21:59:30 2015	(r279219)
+++ head/usr.sbin/bhyve/pci_ahci.c	Mon Feb 23 22:31:39 2015	(r279220)
@@ -1968,7 +1968,8 @@ pci_ahci_init(struct vmctx *ctx, struct 
 
 open_fail:
 	if (ret) {
-		blockif_close(sc->port[0].bctx);
+		if (sc->port[0].bctx != NULL)
+			blockif_close(sc->port[0].bctx);
 		free(sc);
 	}
 


More information about the svn-src-head mailing list