All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: "Rustad, Mark D" <mark.d.rustad@intel.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
	James Morris <jmorris@namei.org>,
	Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
	Patrick McHardy <kaber@trash.net>,
	"<netdev@vger.kernel.org>" <netdev@vger.kernel.org>,
	"<kernel-janitors@vger.kernel.org>"
	<kernel-janitors@vger.kernel.org>
Subject: Re: [patch] net: remove an unneeded check
Date: Tue, 06 Aug 2013 12:04:42 +0000	[thread overview]
Message-ID: <20130806120442.GR5051@mwanda> (raw)
In-Reply-To: <F3E01662-FC33-4FB8-AF30-47DF44252296@intel.com>

On Mon, Aug 05, 2013 at 06:18:01PM +0000, Rustad, Mark D wrote:
> On Jul 29, 2013, at 12:15 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> 
> > "ifa->ifa_label" is an array inside the in_ifaddr struct.  It can never
> > be NULL so we can remove this check.
> > 
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > 
> > diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
> > index 8d48c39..1b7f7ae 100644
> > --- a/net/ipv4/devinet.c
> > +++ b/net/ipv4/devinet.c
> > @@ -1124,10 +1124,7 @@ static int inet_gifconf(struct net_device *dev, char __user *buf, int len)
> > 		if (len < (int) sizeof(ifr))
> > 			break;
> > 		memset(&ifr, 0, sizeof(struct ifreq));
> > -		if (ifa->ifa_label)
> 
> Is there any possibility that this was meant to check ifa->ifa_label[0]?

It has been this way for almost 16 years and no one has complained.
I should have put that into the changelog though, you are right.

regards,
dan carpenter


WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: "Rustad, Mark D" <mark.d.rustad@intel.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
	James Morris <jmorris@namei.org>,
	Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
	Patrick McHardy <kaber@trash.net>,
	"<netdev@vger.kernel.org>" <netdev@vger.kernel.org>,
	"<kernel-janitors@vger.kernel.org>"
	<kernel-janitors@vger.kernel.org>
Subject: Re: [patch] net: remove an unneeded check
Date: Tue, 6 Aug 2013 15:04:42 +0300	[thread overview]
Message-ID: <20130806120442.GR5051@mwanda> (raw)
In-Reply-To: <F3E01662-FC33-4FB8-AF30-47DF44252296@intel.com>

On Mon, Aug 05, 2013 at 06:18:01PM +0000, Rustad, Mark D wrote:
> On Jul 29, 2013, at 12:15 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> 
> > "ifa->ifa_label" is an array inside the in_ifaddr struct.  It can never
> > be NULL so we can remove this check.
> > 
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > 
> > diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
> > index 8d48c39..1b7f7ae 100644
> > --- a/net/ipv4/devinet.c
> > +++ b/net/ipv4/devinet.c
> > @@ -1124,10 +1124,7 @@ static int inet_gifconf(struct net_device *dev, char __user *buf, int len)
> > 		if (len < (int) sizeof(ifr))
> > 			break;
> > 		memset(&ifr, 0, sizeof(struct ifreq));
> > -		if (ifa->ifa_label)
> 
> Is there any possibility that this was meant to check ifa->ifa_label[0]?

It has been this way for almost 16 years and no one has complained.
I should have put that into the changelog though, you are right.

regards,
dan carpenter

  reply	other threads:[~2013-08-06 12:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-29 19:15 [patch] net: remove an unneeded check Dan Carpenter
2013-07-29 19:15 ` Dan Carpenter
2013-07-29 21:17 ` Jiri Pirko
2013-07-29 21:17   ` Jiri Pirko
2013-07-31  2:24 ` David Miller
2013-07-31  2:24   ` David Miller
2013-08-05 18:18 ` Rustad, Mark D
2013-08-05 18:18   ` Rustad, Mark D
2013-08-06 12:04   ` Dan Carpenter [this message]
2013-08-06 12:04     ` Dan Carpenter

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=20130806120442.GR5051@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=jmorris@namei.org \
    --cc=kaber@trash.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=mark.d.rustad@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=yoshfuji@linux-ipv6.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.