diff options
author | pjd <pjd@FreeBSD.org> | 2010-09-23 11:26:38 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2010-09-23 11:26:38 +0000 |
commit | 4c64468739ebe2152f8986b38d0b3cd8f15dccf7 (patch) | |
tree | 35dd553a6e3f8b780760026b29c2d2f70e11e8ba | |
parent | 8c781f88d0ac500c14265e79152e83ab458a7968 (diff) | |
download | FreeBSD-src-4c64468739ebe2152f8986b38d0b3cd8f15dccf7.zip FreeBSD-src-4c64468739ebe2152f8986b38d0b3cd8f15dccf7.tar.gz |
Simplify code a bit.
MFC after: 1 week
-rw-r--r-- | sys/crypto/aesni/aesni.c | 4 | ||||
-rw-r--r-- | sys/crypto/aesni/aesni_wrap.c | 11 |
2 files changed, 5 insertions, 10 deletions
diff --git a/sys/crypto/aesni/aesni.c b/sys/crypto/aesni/aesni.c index 93ee042..fd13e3a 100644 --- a/sys/crypto/aesni/aesni.c +++ b/sys/crypto/aesni/aesni.c @@ -69,14 +69,12 @@ aesni_identify(driver_t *drv, device_t parent) static int aesni_probe(device_t dev) { - char capp[32]; if ((cpu_feature2 & CPUID2_AESNI) == 0) { device_printf(dev, "No AESNI support.\n"); return (EINVAL); } - strlcpy(capp, "AES-CBC", sizeof(capp)); - device_set_desc_copy(dev, capp); + device_set_desc_copy(dev, "AES-CBC"); return (0); } diff --git a/sys/crypto/aesni/aesni_wrap.c b/sys/crypto/aesni/aesni_wrap.c index fd08222..496b59b 100644 --- a/sys/crypto/aesni/aesni_wrap.c +++ b/sys/crypto/aesni/aesni_wrap.c @@ -147,15 +147,13 @@ aesni_cipher_process(struct aesni_session *ses, struct cryptodesc *enccrd, int error, allocated; buf = aesni_cipher_alloc(enccrd, crp, &allocated); - if (buf == NULL) { - error = ENOMEM; - goto out; - } + if (buf == NULL) + return (ENOMEM); td = curthread; error = fpu_kern_enter(td, &ses->fpu_ctx, FPU_KERN_NORMAL); if (error != 0) - goto out1; + goto out; if ((enccrd->crd_flags & CRD_F_ENCRYPT) != 0) { if ((enccrd->crd_flags & CRD_F_IV_EXPLICIT) != 0) @@ -184,11 +182,10 @@ aesni_cipher_process(struct aesni_session *ses, struct cryptodesc *enccrd, crypto_copydata(crp->crp_flags, crp->crp_buf, enccrd->crd_skip + enccrd->crd_len - AES_BLOCK_LEN, AES_BLOCK_LEN, ses->iv); - out1: + out: if (allocated) { bzero(buf, enccrd->crd_len); free(buf, M_AESNI); } - out: return (error); } |