mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 14:04:54 +02:00
chelsio/chtls: unlock on error in chtls_pt_recvmsg()
[ Upstream commit832ce924b1] This error path needs to release some memory and call release_sock(sk); before returning. Fixes:6919a8264a("Crypto/chtls: add/delete TLS header in driver") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
8ee7ef4a57
commit
4246f7dc35
|
|
@ -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,
|
cerr = put_cmsg(msg, SOL_TLS, TLS_GET_RECORD_TYPE,
|
||||||
sizeof(thdr->type), &thdr->type);
|
sizeof(thdr->type), &thdr->type);
|
||||||
|
|
||||||
if (cerr && thdr->type != TLS_RECORD_TYPE_DATA)
|
if (cerr && thdr->type != TLS_RECORD_TYPE_DATA) {
|
||||||
return -EIO;
|
copied = -EIO;
|
||||||
|
break;
|
||||||
|
}
|
||||||
/* don't send tls header, skip copy */
|
/* don't send tls header, skip copy */
|
||||||
goto skip_copy;
|
goto skip_copy;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user