Date: Mon, 23 Feb 2015 22:31:40 +0000 (UTC) From: Peter Grehan <grehan@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279220 - head/usr.sbin/bhyve Message-ID: <201502232231.t1NMVeCu084670@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201502232231.t1NMVeCu084670>