mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-25 16:13:17 +00:00
Don't check maps for static DMA allocations against NULL to see if an
allocation succeeded. Instead, check the tag against NULL.
This commit is contained in:
parent
aced5239b2
commit
8d461aafd8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=267448
@ -2301,25 +2301,25 @@ ubsec_kprocess_modexp_sw(struct ubsec_softc *sc, struct cryptkop *krp, int hint)
|
||||
|
||||
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_softc *sc, struct cryptkop *krp, int hint)
|
||||
|
||||
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_softc *sc, struct cryptkop *krp, int hint)
|
||||
|
||||
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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user