* [PATCH] inet: set `error' value not under lock_sock().
@ 2016-03-09 18:22 Weongyo Jeong
2016-03-09 20:37 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Weongyo Jeong @ 2016-03-09 18:22 UTC (permalink / raw)
To: netdev
A trivial patch to set `error' variable while not holding
lock_sock().
Signed-off-by: Weongyo Jeong <weongyo.linux@gmail.com>
---
net/ipv4/inet_connection_sock.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index 6414891..58bc39f 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -306,14 +306,13 @@ struct sock *inet_csk_accept(struct sock *sk, int flags, int *err)
struct request_sock_queue *queue = &icsk->icsk_accept_queue;
struct request_sock *req;
struct sock *newsk;
- int error;
+ int error = -EINVAL;
lock_sock(sk);
/* We need to make sure that this socket is listening,
* and that it has something pending.
*/
- error = -EINVAL;
if (sk->sk_state != TCP_LISTEN)
goto out_err;
--
2.1.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] inet: set `error' value not under lock_sock().
2016-03-09 18:22 [PATCH] inet: set `error' value not under lock_sock() Weongyo Jeong
@ 2016-03-09 20:37 ` David Miller
2016-03-09 22:46 ` Weongyo Jeong
0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2016-03-09 20:37 UTC (permalink / raw)
To: wjeong, weongyo.linux; +Cc: netdev
From: Weongyo Jeong <weongyo.linux@gmail.com>
Date: Wed, 9 Mar 2016 10:22:21 -0800
> A trivial patch to set `error' variable while not holding
> lock_sock().
>
> Signed-off-by: Weongyo Jeong <weongyo.linux@gmail.com>
Deferring the assignment means gcc doesn't have to potentially put it
on the stack across the lock_sock() call.
You're making the code worse not better, the assignment into a local
variable is not an expensive operation.
I'm not applying this change, sorry.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] inet: set `error' value not under lock_sock().
2016-03-09 20:37 ` David Miller
@ 2016-03-09 22:46 ` Weongyo Jeong
0 siblings, 0 replies; 3+ messages in thread
From: Weongyo Jeong @ 2016-03-09 22:46 UTC (permalink / raw)
To: David Miller, weongyo.linux@gmail.com; +Cc: netdev@vger.kernel.org
On 03/09/2016 12:37 PM, David Miller wrote:
> From: Weongyo Jeong <weongyo.linux@gmail.com>
> Date: Wed, 9 Mar 2016 10:22:21 -0800
>
>> A trivial patch to set `error' variable while not holding
>> lock_sock().
>>
>> Signed-off-by: Weongyo Jeong <weongyo.linux@gmail.com>
>
> Deferring the assignment means gcc doesn't have to potentially put it
> on the stack across the lock_sock() call.
>
> You're making the code worse not better, the assignment into a local
> variable is not an expensive operation.
>
> I'm not applying this change, sorry.
No problem. Thank you for review and opinion.
Regards,
Weongyo Jeong
===========================================================
Considering Office 365? Barracuda security and storage solutions can help. Learn more about Barracuda solutions for Office 365 at http://barracuda.com/office365.
DISCLAIMER:
This e-mail and any attachments to it contain confidential and proprietary material of Barracuda, its affiliates or agents, and is solely for the use of the intended recipient. Any review, use, disclosure, distribution or copying of this transmittal is prohibited except by or on behalf of the intended recipient. If you have received this transmittal in error, please notify the sender and destroy this e-mail and any attachments and all copies, whether electronic or printed.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-03-09 22:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-09 18:22 [PATCH] inet: set `error' value not under lock_sock() Weongyo Jeong
2016-03-09 20:37 ` David Miller
2016-03-09 22:46 ` Weongyo Jeong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).