perf probe: Fix memory leak when synthesizing SDT probes
[linux-2.6-microblaze.git] / crypto / algif_aead.c
index 21efa78..42493b4 100644 (file)
@@ -78,7 +78,7 @@ static int crypto_aead_copy_sgl(struct crypto_sync_skcipher *null_tfm,
        SYNC_SKCIPHER_REQUEST_ON_STACK(skreq, null_tfm);
 
        skcipher_request_set_sync_tfm(skreq, null_tfm);
-       skcipher_request_set_callback(skreq, CRYPTO_TFM_REQ_MAY_BACKLOG,
+       skcipher_request_set_callback(skreq, CRYPTO_TFM_REQ_MAY_SLEEP,
                                      NULL, NULL);
        skcipher_request_set_crypt(skreq, src, dst, len, NULL);
 
@@ -120,7 +120,7 @@ static int _aead_recvmsg(struct socket *sock, struct msghdr *msg,
 
        /*
         * Make sure sufficient data is present -- note, the same check is
-        * is also present in sendmsg/sendpage. The checks in sendpage/sendmsg
+        * also present in sendmsg/sendpage. The checks in sendpage/sendmsg
         * shall provide an information to the data sender that something is
         * wrong, but they are irrelevant to maintain the kernel integrity.
         * We need this check here too in case user space decides to not honor
@@ -291,19 +291,20 @@ static int _aead_recvmsg(struct socket *sock, struct msghdr *msg,
                areq->outlen = outlen;
 
                aead_request_set_callback(&areq->cra_u.aead_req,
-                                         CRYPTO_TFM_REQ_MAY_BACKLOG,
+                                         CRYPTO_TFM_REQ_MAY_SLEEP,
                                          af_alg_async_cb, areq);
                err = ctx->enc ? crypto_aead_encrypt(&areq->cra_u.aead_req) :
                                 crypto_aead_decrypt(&areq->cra_u.aead_req);
 
                /* AIO operation in progress */
-               if (err == -EINPROGRESS || err == -EBUSY)
+               if (err == -EINPROGRESS)
                        return -EIOCBQUEUED;
 
                sock_put(sk);
        } else {
                /* Synchronous operation */
                aead_request_set_callback(&areq->cra_u.aead_req,
+                                         CRYPTO_TFM_REQ_MAY_SLEEP |
                                          CRYPTO_TFM_REQ_MAY_BACKLOG,
                                          crypto_req_done, &ctx->wait);
                err = crypto_wait_req(ctx->enc ?