From 5afb72ae5bcfad3be81fda47f1bc6d5d580c0b53 Mon Sep 17 00:00:00 2001 From: Frederic Robra Date: Mon, 11 Nov 2019 17:22:39 +0100 Subject: bug when sending and release at the same time --- src/kernel/net-txrx.c | 1 - src/kernel/net.c | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kernel/net-txrx.c b/src/kernel/net-txrx.c index 27b07ea..3a9b057 100644 --- a/src/kernel/net-txrx.c +++ b/src/kernel/net-txrx.c @@ -227,7 +227,6 @@ int dnbd3_send_request_cmd(struct dnbd3_sock *sock, uint16_t dnbd3_cmd) result = -EIO; goto error; } - sock->pending = req; result = dnbd3_send_request(sock, req, NULL); error: diff --git a/src/kernel/net.c b/src/kernel/net.c index 5f9846a..838aafb 100644 --- a/src/kernel/net.c +++ b/src/kernel/net.c @@ -37,8 +37,9 @@ #define dnbd3_sock_release(sock) \ do { \ - sock_release((sock)->sock); \ + struct socket *s = (sock)->sock; \ sock->sock = NULL; \ + sock_release(s); \ }while (0) #define dnbd3_is_sock_alive(s) ((s).sock && (s).server) -- cgit v1.2.3-55-g7522