Commit 898132ae authored by Dan Carpenter's avatar Dan Carpenter Committed by Eric W. Biederman

ipv6: move dereference after check in fl_free()

There is a dereference before checking for NULL bug here.  Generally
free() functions should accept NULL pointers.  For example, fl_create()
can pass a NULL pointer to fl_free() on the error path.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
parent 0625c883
...@@ -91,12 +91,9 @@ static struct ip6_flowlabel *fl_lookup(struct net *net, __be32 label) ...@@ -91,12 +91,9 @@ static struct ip6_flowlabel *fl_lookup(struct net *net, __be32 label)
static void fl_free(struct ip6_flowlabel *fl) static void fl_free(struct ip6_flowlabel *fl)
{ {
switch (fl->share) {
case IPV6_FL_S_PROCESS:
put_pid(fl->owner.pid);
break;
}
if (fl) { if (fl) {
if (fl->share == IPV6_FL_S_PROCESS)
put_pid(fl->owner.pid);
release_net(fl->fl_net); release_net(fl->fl_net);
kfree(fl->opt); kfree(fl->opt);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment