netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: Simon Horman <simon.horman@netronome.com>
Cc: Linux Kernel Network Developers <netdev@vger.kernel.org>,
	Tom Herbert <tom@herbertland.com>
Subject: Re: [PATCH net] fou: avoid using sk_user_data before it is initialised
Date: Wed, 18 May 2016 09:46:13 -0700	[thread overview]
Message-ID: <CAM_iQpWfvcRMoXPsuOq6fi1TufzOYZWCg0FwpyDN2WNbTd3gmg@mail.gmail.com> (raw)
In-Reply-To: <1463560216-26616-1-git-send-email-simon.horman@netronome.com>

On Wed, May 18, 2016 at 1:30 AM, Simon Horman
<simon.horman@netronome.com> wrote:
> During initialisation sk->sk_user_data should be initialised before
> it is referenced via a call to gue_encap_init().

Or just use 'fou' directly?

diff --git a/net/ipv4/fou.c b/net/ipv4/fou.c
index eeec7d6..0b7a983 100644
--- a/net/ipv4/fou.c
+++ b/net/ipv4/fou.c
@@ -453,7 +453,7 @@ static int fou_encap_init(struct sock *sk, struct
fou *fou, struct fou_cfg *cfg)
        udp_sk(sk)->encap_rcv = fou_udp_recv;
        udp_sk(sk)->gro_receive = fou_gro_receive;
        udp_sk(sk)->gro_complete = fou_gro_complete;
-       fou_from_sock(sk)->protocol = cfg->protocol;
+       fou->protocol = cfg->protocol;

        return 0;
 }

      parent reply	other threads:[~2016-05-18 16:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-18  8:30 [PATCH net] fou: avoid using sk_user_data before it is initialised Simon Horman
2016-05-18 16:30 ` Tom Herbert
2016-05-18 17:07   ` Cong Wang
2016-05-18 17:16     ` Tom Herbert
2016-05-20  5:17       ` Cong Wang
2016-05-20  5:58         ` Simon Horman
2016-05-18 16:46 ` Cong Wang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAM_iQpWfvcRMoXPsuOq6fi1TufzOYZWCg0FwpyDN2WNbTd3gmg@mail.gmail.com \
    --to=xiyou.wangcong@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=simon.horman@netronome.com \
    --cc=tom@herbertland.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).