Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Jun 2014 19:34:35 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r267448 - head/sys/dev/ubsec
Message-ID:  <201406131934.s5DJYZuj081731@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Fri Jun 13 19:34:34 2014
New Revision: 267448
URL: http://svnweb.freebsd.org/changeset/base/267448

Log:
  Don't check maps for static DMA allocations against NULL to see if an
  allocation succeeded.  Instead, check the tag against NULL.

Modified:
  head/sys/dev/ubsec/ubsec.c

Modified: head/sys/dev/ubsec/ubsec.c
==============================================================================
--- head/sys/dev/ubsec/ubsec.c	Fri Jun 13 19:10:40 2014	(r267447)
+++ head/sys/dev/ubsec/ubsec.c	Fri Jun 13 19:34:34 2014	(r267448)
@@ -2301,25 +2301,25 @@ ubsec_kprocess_modexp_sw(struct ubsec_so
 
 errout:
 	if (me != NULL) {
-		if (me->me_q.q_mcr.dma_map != NULL)
+		if (me->me_q.q_mcr.dma_tag != NULL)
 			ubsec_dma_free(sc, &me->me_q.q_mcr);
-		if (me->me_q.q_ctx.dma_map != NULL) {
+		if (me->me_q.q_ctx.dma_tag != NULL) {
 			bzero(me->me_q.q_ctx.dma_vaddr, me->me_q.q_ctx.dma_size);
 			ubsec_dma_free(sc, &me->me_q.q_ctx);
 		}
-		if (me->me_M.dma_map != NULL) {
+		if (me->me_M.dma_tag != NULL) {
 			bzero(me->me_M.dma_vaddr, me->me_M.dma_size);
 			ubsec_dma_free(sc, &me->me_M);
 		}
-		if (me->me_E.dma_map != NULL) {
+		if (me->me_E.dma_tag != NULL) {
 			bzero(me->me_E.dma_vaddr, me->me_E.dma_size);
 			ubsec_dma_free(sc, &me->me_E);
 		}
-		if (me->me_C.dma_map != NULL) {
+		if (me->me_C.dma_tag != NULL) {
 			bzero(me->me_C.dma_vaddr, me->me_C.dma_size);
 			ubsec_dma_free(sc, &me->me_C);
 		}
-		if (me->me_epb.dma_map != NULL)
+		if (me->me_epb.dma_tag != NULL)
 			ubsec_dma_free(sc, &me->me_epb);
 		free(me, M_DEVBUF);
 	}
@@ -2502,25 +2502,25 @@ ubsec_kprocess_modexp_hw(struct ubsec_so
 
 errout:
 	if (me != NULL) {
-		if (me->me_q.q_mcr.dma_map != NULL)
+		if (me->me_q.q_mcr.dma_tag != NULL)
 			ubsec_dma_free(sc, &me->me_q.q_mcr);
-		if (me->me_q.q_ctx.dma_map != NULL) {
+		if (me->me_q.q_ctx.dma_tag != NULL) {
 			bzero(me->me_q.q_ctx.dma_vaddr, me->me_q.q_ctx.dma_size);
 			ubsec_dma_free(sc, &me->me_q.q_ctx);
 		}
-		if (me->me_M.dma_map != NULL) {
+		if (me->me_M.dma_tag != NULL) {
 			bzero(me->me_M.dma_vaddr, me->me_M.dma_size);
 			ubsec_dma_free(sc, &me->me_M);
 		}
-		if (me->me_E.dma_map != NULL) {
+		if (me->me_E.dma_tag != NULL) {
 			bzero(me->me_E.dma_vaddr, me->me_E.dma_size);
 			ubsec_dma_free(sc, &me->me_E);
 		}
-		if (me->me_C.dma_map != NULL) {
+		if (me->me_C.dma_tag != NULL) {
 			bzero(me->me_C.dma_vaddr, me->me_C.dma_size);
 			ubsec_dma_free(sc, &me->me_C);
 		}
-		if (me->me_epb.dma_map != NULL)
+		if (me->me_epb.dma_tag != NULL)
 			ubsec_dma_free(sc, &me->me_epb);
 		free(me, M_DEVBUF);
 	}
@@ -2696,13 +2696,13 @@ ubsec_kprocess_rsapriv(struct ubsec_soft
 
 errout:
 	if (rp != NULL) {
-		if (rp->rpr_q.q_mcr.dma_map != NULL)
+		if (rp->rpr_q.q_mcr.dma_tag != NULL)
 			ubsec_dma_free(sc, &rp->rpr_q.q_mcr);
-		if (rp->rpr_msgin.dma_map != NULL) {
+		if (rp->rpr_msgin.dma_tag != NULL) {
 			bzero(rp->rpr_msgin.dma_vaddr, rp->rpr_msgin.dma_size);
 			ubsec_dma_free(sc, &rp->rpr_msgin);
 		}
-		if (rp->rpr_msgout.dma_map != NULL) {
+		if (rp->rpr_msgout.dma_tag != NULL) {
 			bzero(rp->rpr_msgout.dma_vaddr, rp->rpr_msgout.dma_size);
 			ubsec_dma_free(sc, &rp->rpr_msgout);
 		}



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