]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - net/ipv4/syncookies.c
UBUNTU: Ubuntu-4.15.0-96.97
[mirror_ubuntu-bionic-kernel.git] / net / ipv4 / syncookies.c
index fda37f2862c923eb8b6d0b49d9442950fc6a7446..ad80f4a43edec17e3de4fca4f532e11249be78b5 100644 (file)
@@ -216,7 +216,12 @@ struct sock *tcp_get_cookie_sock(struct sock *sk, struct sk_buff *skb,
                refcount_set(&req->rsk_refcnt, 1);
                tcp_sk(child)->tsoffset = tsoff;
                sock_rps_save_rxhash(child, skb);
-               inet_csk_reqsk_queue_add(sk, req, child);
+               if (!inet_csk_reqsk_queue_add(sk, req, child)) {
+                       bh_unlock_sock(child);
+                       sock_put(child);
+                       child = NULL;
+                       reqsk_put(req);
+               }
        } else {
                reqsk_free(req);
        }