PERFORCE change 1202878 for review

John-Mark Gurney jmg at FreeBSD.org
Sun Nov 16 06:01:09 UTC 2014


http://p4web.freebsd.org/@@1202878?ac=10

Change 1202878 by jmg at jmg_carbon2 on 2014/11/16 06:00:34

	reenable avoid allocation of memory for single mbufs...  I wasn't
	taking into account the crd_skip...  All of these need to take
	this into account, so pull it out of the set of if statements..
	
	Sponsored by:	FreeBSD Foundation
	Sponsored by:	Netgate

Affected files ...

.. //depot/projects/opencrypto/sys/crypto/aesni/aesni.c#16 edit

Differences ...

==== //depot/projects/opencrypto/sys/crypto/aesni/aesni.c#16 (text+ko) ====

@@ -382,7 +382,6 @@
 	uint8_t *addr;
 
 	if (crp->crp_flags & CRYPTO_F_IMBUF) {
-		goto alloc;
 		m = (struct mbuf *)crp->crp_buf;
 		if (m->m_next != NULL)
 			goto alloc;
@@ -392,10 +391,11 @@
 		if (uio->uio_iovcnt != 1)
 			goto alloc;
 		iov = uio->uio_iov;
-		addr = (uint8_t *)iov->iov_base + enccrd->crd_skip;
+		addr = (uint8_t *)iov->iov_base;
 	} else
 		addr = (uint8_t *)crp->crp_buf;
 	*allocated = 0;
+	addr += enccrd->crd_skip;
 	return (addr);
 
 alloc:


More information about the p4-projects mailing list