diff mbox series

[net] af_unix: Correct comment to reference kfree_skb_reason hook

Message ID 20250124015106.2226585-1-buaajxlj@163.com (mailing list archive)
State Deferred
Delegated to: Netdev Maintainers
Headers show
Series [net] af_unix: Correct comment to reference kfree_skb_reason hook | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 2 this patch: 2
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 4 this patch: 4
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest fail net-next-2025-01-24--03-00 (tests: 878)

Commit Message

Liang Jie Jan. 24, 2025, 1:51 a.m. UTC
From: Liang Jie <liangjie@lixiang.com>

The comment in unix_release_sock has been updated to correctly reference
kfree_skb_reason instead of kfree_skb, for clarity on how passed file
descriptors are handled during socket closure.

Fixes: c32f0bd7d483 ("af_unix: Set drop reason in unix_release_sock().")
Signed-off-by: Liang Jie <liangjie@lixiang.com>
---
 net/unix/af_unix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kuniyuki Iwashima Jan. 24, 2025, 2:11 a.m. UTC | #1
From: Liang Jie <buaajxlj@163.com>
Date: Fri, 24 Jan 2025 09:51:06 +0800
> From: Liang Jie <liangjie@lixiang.com>
> 
> The comment in unix_release_sock has been updated to correctly reference
> kfree_skb_reason instead of kfree_skb, for clarity on how passed file
> descriptors are handled during socket closure.
> 
> Fixes: c32f0bd7d483 ("af_unix: Set drop reason in unix_release_sock().")

This is net-next material and Fixes tag is not needed.

I don't think we need to update the comment though..

kfree_skb 'hook' generally means skb->destructor() and _reason is
not relevant here.

kfree_skb
  kfree_skb_reason
    sk_skb_reason_drop
      __kfree_skb
        skb_release_all
          skb_release_head_state
            skb->destructor / unix_destruct_scm <--


> Signed-off-by: Liang Jie <liangjie@lixiang.com>
> ---
>  net/unix/af_unix.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
> index 34945de1fb1f..47dd3749ce32 100644
> --- a/net/unix/af_unix.c
> +++ b/net/unix/af_unix.c
> @@ -717,7 +717,7 @@ static void unix_release_sock(struct sock *sk, int embrion)
>  		if (state == TCP_LISTEN)
>  			unix_release_sock(skb->sk, 1);
>  
> -		/* passed fds are erased in the kfree_skb hook */
> +		/* passed fds are erased in the kfree_skb_reason hook */
>  		kfree_skb_reason(skb, SKB_DROP_REASON_SOCKET_CLOSE);
>  	}
>  
> -- 
> 2.25.1
diff mbox series

Patch

diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 34945de1fb1f..47dd3749ce32 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -717,7 +717,7 @@  static void unix_release_sock(struct sock *sk, int embrion)
 		if (state == TCP_LISTEN)
 			unix_release_sock(skb->sk, 1);
 
-		/* passed fds are erased in the kfree_skb hook */
+		/* passed fds are erased in the kfree_skb_reason hook */
 		kfree_skb_reason(skb, SKB_DROP_REASON_SOCKET_CLOSE);
 	}