diff options
author | Frederic Robra | 2019-11-11 17:22:39 +0100 |
---|---|---|
committer | Frederic Robra | 2019-11-11 17:22:39 +0100 |
commit | 5afb72ae5bcfad3be81fda47f1bc6d5d580c0b53 (patch) | |
tree | 53db94a0713150e55a1f07c615897b4a29af23b7 | |
parent | added timeout and small bug when reqeuing in send (diff) | |
download | dnbd3-ng-5afb72ae5bcfad3be81fda47f1bc6d5d580c0b53.tar.gz dnbd3-ng-5afb72ae5bcfad3be81fda47f1bc6d5d580c0b53.tar.xz dnbd3-ng-5afb72ae5bcfad3be81fda47f1bc6d5d580c0b53.zip |
bug when sending and release at the same time
-rw-r--r-- | src/kernel/net-txrx.c | 1 | ||||
-rw-r--r-- | 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) |