From: Eric Dumazet Date: Wed, 5 Jun 2024 07:15:51 +0000 (+0000) Subject: tcp: small changes in reqsk_put() and reqsk_free() X-Git-Tag: v6.11-rc1~163^2~235^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c34506406dd5cfb352f8c53bb6a1b9535c0905dd;p=thirdparty%2Flinux.git tcp: small changes in reqsk_put() and reqsk_free() In reqsk_free(), use DEBUG_NET_WARN_ON_ONCE() instead of WARN_ON_ONCE() for a condition which never fired. In reqsk_put() directly call __reqsk_free(), there is no point checking rsk_refcnt again right after a transition to zero. Signed-off-by: Eric Dumazet Reviewed-by: Kuniyuki Iwashima Signed-off-by: Paolo Abeni --- diff --git a/include/net/request_sock.h b/include/net/request_sock.h index ebcb8896bffc1..a8f82216c6287 100644 --- a/include/net/request_sock.h +++ b/include/net/request_sock.h @@ -172,14 +172,14 @@ static inline void __reqsk_free(struct request_sock *req) static inline void reqsk_free(struct request_sock *req) { - WARN_ON_ONCE(refcount_read(&req->rsk_refcnt) != 0); + DEBUG_NET_WARN_ON_ONCE(refcount_read(&req->rsk_refcnt) != 0); __reqsk_free(req); } static inline void reqsk_put(struct request_sock *req) { if (refcount_dec_and_test(&req->rsk_refcnt)) - reqsk_free(req); + __reqsk_free(req); } /*