From: "Rustad, Mark D" <mark.d.rustad@intel.com>
To: Dan Carpenter <dan.carpenter@oracle.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: Mon, 05 Aug 2013 18:18:01 +0000 [thread overview]
Message-ID: <F3E01662-FC33-4FB8-AF30-47DF44252296@intel.com> (raw)
In-Reply-To: <20130729191519.GA11874@elgon.mountain>
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]?
> - strcpy(ifr.ifr_name, ifa->ifa_label);
> - else
> - strcpy(ifr.ifr_name, dev->name);
> + strcpy(ifr.ifr_name, ifa->ifa_label);
>
> (*(struct sockaddr_in *)&ifr.ifr_addr).sin_family = AF_INET;
> (*(struct sockaddr_in *)&ifr.ifr_addr).sin_addr.s_addr
--
Mark Rustad, Networking Division, Intel Corporation
next prev parent reply other threads:[~2013-08-05 18:18 UTC|newest]
Thread overview: 5+ 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 21:17 ` Jiri Pirko
2013-07-31 2:24 ` David Miller
2013-08-05 18:18 ` Rustad, Mark D [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=F3E01662-FC33-4FB8-AF30-47DF44252296@intel.com \
--to=mark.d.rustad@intel.com \
--cc=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=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox