diff options
author | sam <sam@FreeBSD.org> | 2005-02-25 21:57:46 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2005-02-25 21:57:46 +0000 |
commit | 0eb9795c42e0f95e7468189ab75d454ce4f2db25 (patch) | |
tree | fcf253c4118966718120debf5bde7fea42ac5be4 /sys/dev/sym/sym_hipd.c | |
parent | f1482428e1d20f001be32c59256c11419289b921 (diff) | |
download | FreeBSD-src-0eb9795c42e0f95e7468189ab75d454ce4f2db25.zip FreeBSD-src-0eb9795c42e0f95e7468189ab75d454ce4f2db25.tar.gz |
avoid null ptr deref
Noticed by: Coverity Prevent analysis tool
Reviewed by: scottl
Diffstat (limited to 'sys/dev/sym/sym_hipd.c')
-rw-r--r-- | sys/dev/sym/sym_hipd.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/sym/sym_hipd.c b/sys/dev/sym/sym_hipd.c index a737671..103d539 100644 --- a/sys/dev/sym/sym_hipd.c +++ b/sys/dev/sym/sym_hipd.c @@ -700,10 +700,11 @@ out_err: bus_dmamap_unload(mp->dmat, vbp->dmamap); if (vaddr) bus_dmamem_free(mp->dmat, vaddr, vbp->dmamap); - if (vbp->dmamap) - bus_dmamap_destroy(mp->dmat, vbp->dmamap); - if (vbp) + if (vbp) { + if (vbp->dmamap) + bus_dmamap_destroy(mp->dmat, vbp->dmamap); __sym_mfree(&mp0, vbp, sizeof(*vbp), "VTOB"); + } return 0; } |