Skip to contentSkip to conversation

chelsio/chtls: unlock on error in chtls_pt_recvmsg()

PATCH Applied Dan Carpenter 2 participants 2 messages May 12, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 chelsio/chtls: unlock on error in chtls_pt_recvmsg()

This error path needs to release some memory and call release_sock(sk); before returning.

Fixes 6919a8264a32 ("Crypto/chtls: add/delete TLS header in driver")
---
 drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c +4 -2
index 188d871f6b8c..c320cc8ca68d 100644
@@ -1564,8 +1564,10 @@ static int chtls_pt_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
 			cerr = put_cmsg(msg, SOL_TLS, TLS_GET_RECORD_TYPE,
 					sizeof(thdr->type), &thdr->type);
 
-			if (cerr && thdr->type != TLS_RECORD_TYPE_DATA)
-				return -EIO;
+			if (cerr && thdr->type != TLS_RECORD_TYPE_DATA) {
+				copied = -EIO;
+				break;
+			}
 			/*  don't send tls header, skip copy */
 			goto skip_copy;
 		}
Signature · 1 line
2.30.2
#1 lore raw
This patch was applied to netdev/net.git (refs/heads/master):

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

Quoted 8 lines · On Wed, 12 May 2021 13:02:48 +0300 you wrote:

This error path needs to release some memory and call release_sock(sk); before returning.

Fixes 6919a8264a32 ("Crypto/chtls: add/delete TLS header in driver")
---
 drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Here is the summary with links:
- [net] chelsio/chtls: unlock on error in chtls_pt_recvmsg()

    https://git.kernel.org/netdev/net/c/832ce924b1a1

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html