svn commit: r190541 - head/sys/dev/malo
Weongyo Jeong
weongyo at FreeBSD.org
Mon Mar 30 01:39:43 PDT 2009
Author: weongyo
Date: Mon Mar 30 08:39:42 2009
New Revision: 190541
URL: http://svn.freebsd.org/changeset/base/190541
Log:
fix a bug of uses after free.
Pointed by: dchagin
MFC after: 3 days
Modified:
head/sys/dev/malo/if_malohal.c
Modified: head/sys/dev/malo/if_malohal.c
==============================================================================
--- head/sys/dev/malo/if_malohal.c Mon Mar 30 05:57:55 2009 (r190540)
+++ head/sys/dev/malo/if_malohal.c Mon Mar 30 08:39:42 2009 (r190541)
@@ -163,8 +163,6 @@ malo_hal_attach(device_t dev, uint16_t d
return (mh);
fail:
- free(mh, M_DEVBUF);
-
if (mh->mh_dmamap != NULL) {
bus_dmamap_unload(mh->mh_dmat, mh->mh_dmamap);
if (mh->mh_cmdbuf != NULL)
@@ -174,6 +172,7 @@ fail:
}
if (mh->mh_dmat)
bus_dma_tag_destroy(mh->mh_dmat);
+ free(mh, M_DEVBUF);
return (NULL);
}
More information about the svn-src-head
mailing list