summaryrefslogtreecommitdiffstats
path: root/cryptodev_cipher.c
diff options
context:
space:
mode:
authorPhil Sutter <phil.sutter@viprinet.com>2010-06-17 15:00:30 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2010-06-17 20:33:52 +0200
commit9fd408230f1fc91f8d877b5f55b1c00e8e89f665 (patch)
treef64bf13cf3ab419cfbc3da5ce4fdbedb8e990181 /cryptodev_cipher.c
parent26e1a7a351626f770514f001457bb307e08a177c (diff)
downloadcryptodev-linux-9fd408230f1fc91f8d877b5f55b1c00e8e89f665.tar.gz
cryptodev-linux-9fd408230f1fc91f8d877b5f55b1c00e8e89f665.tar.xz
cryptodev-linux-9fd408230f1fc91f8d877b5f55b1c00e8e89f665.zip
eliminate warnings about unused result of copy_*_user
Diffstat (limited to 'cryptodev_cipher.c')
-rw-r--r--cryptodev_cipher.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/cryptodev_cipher.c b/cryptodev_cipher.c
index 25ef44e..2f52f46 100644
--- a/cryptodev_cipher.c
+++ b/cryptodev_cipher.c
@@ -64,7 +64,10 @@ int cryptodev_cipher_init(struct cipher_data* out, const char* alg_name, uint8_t
return -EINVAL;
}
/* Copy the key from user and set to TFM. */
- copy_from_user(keyp, key, keylen);
+ if (unlikely(copy_from_user(keyp, key, keylen))) {
+ dprintk(1, KERN_DEBUG, "copy_from_user() failed for key\n");
+ return -EINVAL;
+ }
out->async.s = crypto_alloc_ablkcipher(alg_name, 0, 0);
if (unlikely(IS_ERR(out->async.s))) {
@@ -135,9 +138,9 @@ void cryptodev_cipher_deinit(struct cipher_data* cdata)
cdata->init = 0;
}
-void cryptodev_cipher_set_iv(struct cipher_data* cdata, void __user* iv, size_t iv_size)
+int cryptodev_cipher_set_iv(struct cipher_data* cdata, void __user* iv, size_t iv_size)
{
- copy_from_user(cdata->async.iv, iv, min(iv_size,sizeof(cdata->async.iv)));
+ return copy_from_user(cdata->async.iv, iv, min(iv_size,sizeof(cdata->async.iv)));
}
static inline int waitfor (struct cryptodev_result* cr, ssize_t ret)
@@ -205,7 +208,10 @@ uint8_t hkeyp[CRYPTO_HMAC_MAX_KEY_LEN];
alg_name, mackeylen*8);
return -EINVAL;
}
- copy_from_user(hkeyp, mackey, mackeylen);
+ if (unlikely(copy_from_user(hkeyp, mackey, mackeylen))) {
+ dprintk(1, KERN_DEBUG, "copy_from_user() failed for mackey\n");
+ return -EINVAL;
+ }
hdata->async.s = crypto_alloc_ahash(alg_name, 0, 0);
if (unlikely(IS_ERR(hdata->async.s))) {