aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-08-16 09:15:02 -0400
committerEric W. Biederman <ebiederm@xmission.com>2012-08-16 19:04:42 -0400
commit898132ae76d1aeb52301f10e8795c34fbb54e853 (patch)
treeae2b9b1482fdabf9456bd741bbd21e485cae8dd6 /net
parent0625c883bc4b3eba6f93f268cf67b5664244c0fe (diff)
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: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'net')
-rw-r--r--net/ipv6/ip6_flowlabel.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c
index c836a6a20a34..90bbefb57943 100644
--- a/net/ipv6/ip6_flowlabel.c
+++ b/net/ipv6/ip6_flowlabel.c
@@ -91,12 +91,9 @@ static struct ip6_flowlabel *fl_lookup(struct net *net, __be32 label)
91 91
92static void fl_free(struct ip6_flowlabel *fl) 92static void fl_free(struct ip6_flowlabel *fl)
93{ 93{
94 switch (fl->share) {
95 case IPV6_FL_S_PROCESS:
96 put_pid(fl->owner.pid);
97 break;
98 }
99 if (fl) { 94 if (fl) {
95 if (fl->share == IPV6_FL_S_PROCESS)
96 put_pid(fl->owner.pid);
100 release_net(fl->fl_net); 97 release_net(fl->fl_net);
101 kfree(fl->opt); 98 kfree(fl->opt);
102 } 99 }