tcp: fix error return code in tcp_xmit_probe_skb
Subsystems (4)
PATCH 1/1 tcp: fix error return code in tcp_xmit_probe_skb
When alloc_skb failed, should return ENOMEM
Signed-off-by Hongbin Wang <[email protected]>
--- net/ipv4/tcp_output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/tcp_output.c +1 -1
@@ -3996,7 +3996,7 @@ static int tcp_xmit_probe_skb(struct sock *sk, int urgent, int mib) skb =alloc_skb (MAX_TCP_HEADER ,sk_gfp_mask (sk,GFP_ATOMIC | __GFP_NOWARN));if (!skb) -return -1 ; +return -ENOMEM ;/* Reserve space for headers and set control bits. */ skb_reserve (skb,MAX_TCP_HEADER );
Signature · 1 line
2.25.1
Quoted 2 lines · Hongbin Wang
When
alloc_skbfailed, should return ENOMEM
Can you explain which rule mandates this statement ?
The only caller that propagates this error has other "return -1;"
The precise value of the error, we do not care, as long it is negative.
To be clear, this error code is not propagated to user space, so this patch only adds code churn.
Quoted 23 lines
Signed-off-by Hongbin Wang <[email protected]>--- net/ipv4/tcp_output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/ipv4/tcp_output.c +1
-2@@ -3996,7 +3996,7 @@ static int tcp_xmit_probe_skb(struct sock *sk, int urgent, int mib) skb =alloc_skb (MAX_TCP_HEADER ,sk_gfp_mask (sk,GFP_ATOMIC | __GFP_NOWARN));if (!skb) -return -1 ; +return -ENOMEM ;/* Reserve space for headers and set control bits. */ skb_reserve (skb,MAX_TCP_HEADER ); --2.25.1