From: Eric Dumazet <eric.dumazet@gmail.com>
To: Xi Wang <xi.wang@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [PATCH] ipv4: fix NULL checking in devinet_ioctl()
Date: Sat, 05 Jan 2013 15:10:02 -0800 [thread overview]
Message-ID: <1357427402.1678.4738.camel@edumazet-glaptop> (raw)
In-Reply-To: <1357420764-12381-1-git-send-email-xi.wang@gmail.com>
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
Thanks
next prev parent reply other threads:[~2013-01-05 23:10 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 [this message]
2013-01-07 5:11 ` David Miller
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=1357427402.1678.4738.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--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