public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: roopa <roopa@cumulusnetworks•com>
To: Dan Carpenter <dan.carpenter@oracle•com>
Cc: "Eric W. Biederman" <ebiederm@xmission•com>, netdev@vger•kernel.org
Subject: Re: af_mpls: fix undefined reference to ip6_route_output
Date: Tue, 04 Aug 2015 06:39:09 -0700	[thread overview]
Message-ID: <55C0C07D.2050505@cumulusnetworks.com> (raw)
In-Reply-To: <20150804074402.GA10867@mwanda>

On 8/4/15, 12:44 AM, Dan Carpenter wrote:
> Hello Roopa,
>
> I have a concern about patch bf21563acc1d: "af_mpls: fix undefined
> reference to ip6_route_output" from Jul 30, 2015.
>
> net/mpls/af_mpls.c
>     450
>     451          dev = find_outdev(net, cfg);
>     452          if (IS_ERR(dev)) {
>
> find_outdev() used to return NULL pointers but now it only returns NULL
> if cfg->rc_via_table == NEIGH_LINK_TABLE or dev_get_by_index() fails.
> I think it could lead to a NULL dereference and we don't check for that
> here.
>
> Returning a mix of error pointers and NULL is bad style, it needs a big
> comment at the top of the function if it's deliberate.
>
>     453                  err = PTR_ERR(dev);
>     454                  dev = NULL;
>     455                  goto errout;
>     456          }
>
>
You are right. The cfg->rc_via_table == NEIGH_LINK_TABLE or 
dev_get_by_index() case, needs a ERR_PTR(-ENODEV).
I will get a patch out shortly.

thanks. I just submitted a patch.

      reply	other threads:[~2015-08-04 13:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-04  7:44 af_mpls: fix undefined reference to ip6_route_output Dan Carpenter
2015-08-04 13:39 ` roopa [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=55C0C07D.2050505@cumulusnetworks.com \
    --to=roopa@cumulusnetworks$(echo .)com \
    --cc=dan.carpenter@oracle$(echo .)com \
    --cc=ebiederm@xmission$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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