Thread (7 messages) read the whole thread 7 messages, 3 authors, 2015-06-11

Re: [PATCH v13 1/2] crypto: AF_ALG: add AEAD support

From: Tadeusz Struk <hidden>
Date: 2015-06-11 22:59:42
Also in: linux-crypto, lkml

Hi Stephan,
On 02/28/2015 11:50 AM, Stephan Mueller wrote:
+	err = af_alg_wait_for_completion(ctx->enc ?
+					 crypto_aead_encrypt(&ctx->aead_req) :
+					 crypto_aead_decrypt(&ctx->aead_req),
+					 &ctx->completion);
+
+	if (err) {
+		/* EBADMSG implies a valid cipher operation took place */
+		if (err == -EBADMSG)
+			aead_put_sgl(sk);
+		goto unlock;
Shouldn't we free the TX sgl regardless of the error was?
Or do we expect that the user will try to read again and it will be Ok the second time?
Hope you still remember :)
+	}
+
+	aead_put_sgl(sk);
+
+	err = 0;
+
+unlock:
+	for (i = 0; i < cnt; i++)
+		af_alg_free_sg(&ctx->rsgl[i]);
+
+	aead_wmem_wakeup(sk);
+	release_sock(sk);
+
+	return err ? err : outlen;
+}
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help