netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: xi.wang@gmail.com, netdev@vger.kernel.org
Subject: Re: [PATCH] ipv4: fix NULL checking in devinet_ioctl()
Date: Sun, 06 Jan 2013 21:11:55 -0800 (PST)	[thread overview]
Message-ID: <20130106.211155.961272945928036494.davem@davemloft.net> (raw)
In-Reply-To: <1357427402.1678.4738.camel@edumazet-glaptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 05 Jan 2013 15:10:02 -0800

> On Sat, 2013-01-05 at 16:19 -0500, Xi Wang wrote:
>> The NULL pointer check `!ifa' should come before its first use.
>> 
>> Signed-off-by: Xi Wang <xi.wang@gmail.com>
>> ---
>>  net/ipv4/devinet.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
>> index cc06a47..a8e4f26 100644
>> --- a/net/ipv4/devinet.c
>> +++ b/net/ipv4/devinet.c
>> @@ -823,9 +823,9 @@ int devinet_ioctl(struct net *net, unsigned int cmd, void __user *arg)
>>  		if (!ifa) {
>>  			ret = -ENOBUFS;
>>  			ifa = inet_alloc_ifa();
>> -			INIT_HLIST_NODE(&ifa->hash);
>>  			if (!ifa)
>>  				break;
>> +			INIT_HLIST_NODE(&ifa->hash);
>>  			if (colon)
>>  				memcpy(ifa->ifa_label, ifr.ifr_name, IFNAMSIZ);
>>  			else
> 
> Acked-by: Eric Dumazet <edumazet@google.com>
> 
> Bug origin : commit fd23c3b31107e2fc483301ee923d8a1db14e53f4
> (ipv4: Add hash table of interface addresses) 
> 
> in linux-2.6.39

Applied and queued up for -stable, thanks.

      reply	other threads:[~2013-01-07  5:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-05 21:19 [PATCH] ipv4: fix NULL checking in devinet_ioctl() Xi Wang
2013-01-05 23:10 ` Eric Dumazet
2013-01-07  5:11   ` David Miller [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=20130106.211155.961272945928036494.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=xi.wang@gmail.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).