All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Maciej Żenczykowski" <zenczykowski@gmail.com>
To: "Maciej Żenczykowski" <maze@google.com>,
	"David S . Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, David Ahern <dsahern@gmail.com>,
	Lorenzo Colitti <lorenzo@google.com>,
	Eric Dumazet <edumazet@google.com>
Subject: [PATCH] net-ipv6: addrconf_f6i_alloc - fix non-null pointer check to !IS_ERR()
Date: Thu,  5 Sep 2019 20:56:37 -0700	[thread overview]
Message-ID: <20190906035637.47097-1-zenczykowski@gmail.com> (raw)
In-Reply-To: <CANP3RGcbEP2N-CDQ6N649k0-cV4AhQeWqF-niz7EMPFOFpkU1w@mail.gmail.com>

From: Maciej Żenczykowski <maze@google.com>

Fixes a stupid bug I recently introduced...
ip6_route_info_create() returns an ERR_PTR(err) and not a NULL on error.

Fixes: d55a2e374a94 ("net-ipv6: fix excessive RTF_ADDRCONF flag on ::1/128 local route (and others)'")
Cc: David Ahern <dsahern@gmail.com>
Cc: Lorenzo Colitti <lorenzo@google.com>
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Maciej Żenczykowski <maze@google.com>
---
 net/ipv6/route.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 003562dd3395..2fb2b913214c 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -4383,7 +4383,7 @@ struct fib6_info *addrconf_f6i_alloc(struct net *net,
 	}
 
 	f6i = ip6_route_info_create(&cfg, gfp_flags, NULL);
-	if (f6i)
+	if (!IS_ERR(f6i))
 		f6i->dst_nocount = true;
 	return f6i;
 }
-- 
2.23.0.187.g17f5b7556c-goog


  reply	other threads:[~2019-09-06  3:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-01 17:47 [PATCH] net-ipv6: fix excessive RTF_ADDRCONF flag on ::1/128 local route (and others) Maciej Żenczykowski
2019-09-01 17:55 ` Maciej Żenczykowski
2019-09-02  2:12   ` Lorenzo Colitti
2019-09-03  2:18     ` David Ahern
2019-09-03  4:58       ` Lorenzo Colitti
2019-09-03 12:17         ` Maciej Żenczykowski
2019-09-03 19:45           ` David Ahern
2019-09-04  3:17             ` Lorenzo Colitti
2019-09-02 13:37 ` David Ahern
2019-09-02 16:23   ` [PATCH v2] " Maciej Żenczykowski
2019-09-03  2:14     ` David Ahern
2019-09-04 22:33     ` David Miller
2019-09-05 18:49     ` Eric Dumazet
2019-09-06  3:31       ` Maciej Żenczykowski
2019-09-06  3:56         ` Maciej Żenczykowski [this message]
2019-09-06  5:10           ` [PATCH] net-ipv6: addrconf_f6i_alloc - fix non-null pointer check to !IS_ERR() Eric Dumazet
2019-09-07 15:48           ` 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=20190906035637.47097-1-zenczykowski@gmail.com \
    --to=zenczykowski@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=edumazet@google.com \
    --cc=lorenzo@google.com \
    --cc=maze@google.com \
    --cc=netdev@vger.kernel.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.