Commit 27ee441a authored by Pablo Neira's avatar Pablo Neira Committed by David S. Miller

gtp: put back reference to netns when not required anymore

This patch fixes a netns leak.

Fixes: 93edb8c7 ("gtp: reload GTPv1 header after pskb_may_pull()")
Reported-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7fd38193
...@@ -1028,8 +1028,11 @@ static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info) ...@@ -1028,8 +1028,11 @@ static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info)
/* Check if there's an existing gtpX device to configure */ /* Check if there's an existing gtpX device to configure */
dev = gtp_find_dev(net, nla_get_u32(info->attrs[GTPA_LINK])); dev = gtp_find_dev(net, nla_get_u32(info->attrs[GTPA_LINK]));
if (dev == NULL) if (dev == NULL) {
put_net(net);
return -ENODEV; return -ENODEV;
}
put_net(net);
return ipv4_pdp_add(dev, info); return ipv4_pdp_add(dev, info);
} }
...@@ -1051,8 +1054,11 @@ static int gtp_genl_del_pdp(struct sk_buff *skb, struct genl_info *info) ...@@ -1051,8 +1054,11 @@ static int gtp_genl_del_pdp(struct sk_buff *skb, struct genl_info *info)
/* Check if there's an existing gtpX device to configure */ /* Check if there's an existing gtpX device to configure */
dev = gtp_find_dev(net, nla_get_u32(info->attrs[GTPA_LINK])); dev = gtp_find_dev(net, nla_get_u32(info->attrs[GTPA_LINK]));
if (dev == NULL) if (dev == NULL) {
put_net(net);
return -ENODEV; return -ENODEV;
}
put_net(net);
gtp = netdev_priv(dev); gtp = netdev_priv(dev);
...@@ -1163,8 +1169,11 @@ static int gtp_genl_get_pdp(struct sk_buff *skb, struct genl_info *info) ...@@ -1163,8 +1169,11 @@ static int gtp_genl_get_pdp(struct sk_buff *skb, struct genl_info *info)
/* Check if there's an existing gtpX device to configure */ /* Check if there's an existing gtpX device to configure */
dev = gtp_find_dev(net, nla_get_u32(info->attrs[GTPA_LINK])); dev = gtp_find_dev(net, nla_get_u32(info->attrs[GTPA_LINK]));
if (dev == NULL) if (dev == NULL) {
put_net(net);
return -ENODEV; return -ENODEV;
}
put_net(net);
gtp = netdev_priv(dev); gtp = netdev_priv(dev);
......
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