summaryrefslogtreecommitdiffstats
path: root/cryptodev_cipher.c
diff options
context:
space:
mode:
authorMichael Weiser <michael@weiser.dinsnail.net>2010-02-26 18:35:49 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2010-02-26 18:35:49 +0100
commit1dfb8ca06b6332b70aa9157605eed984620b50df (patch)
tree331dcb3edd12fb3bff963cb455ee99a30b16c7c9 /cryptodev_cipher.c
parent99f830ad944ba6944ab1f5265ab10532eaef5589 (diff)
downloadkernel-crypto-1dfb8ca06b6332b70aa9157605eed984620b50df.tar.gz
kernel-crypto-1dfb8ca06b6332b70aa9157605eed984620b50df.tar.xz
kernel-crypto-1dfb8ca06b6332b70aa9157605eed984620b50df.zip
cryptodev initialises its sg with sg_set_buf. Although I'm not
sure, what the repercussions are, I changed it to sg_init_one with no ill effects. Added comment for wait_for_completion(). Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Diffstat (limited to 'cryptodev_cipher.c')
-rw-r--r--cryptodev_cipher.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/cryptodev_cipher.c b/cryptodev_cipher.c
index 97998fe6b05..60a55db759e 100644
--- a/cryptodev_cipher.c
+++ b/cryptodev_cipher.c
@@ -148,7 +148,11 @@ static inline int waitfor (struct cryptodev_result* cr, ssize_t ret)
case -EINPROGRESS:
case -EBUSY:
wait_for_completion(&cr->completion);
- /* no error from wait_for_completion */
+ /* At this point we known for sure the request has finished,
+ * because wait_for_completion above was not interruptible.
+ * This is important because otherwise hardware or driver
+ * might try to access memory which will be freed or reused for
+ * another request. */
if (cr->err) {
dprintk(0,KERN_ERR,"error from async request: %zd \n", ret);