Commit f9db9abb authored by Patrick McHardy's avatar Patrick McHardy

Merge coreworks.de:/home/kaber/src/bk-repos/linux-2.6

into coreworks.de:/home/kaber/src/net/net-2.6
parents 6c654e21 ec67cea4
......@@ -537,7 +537,7 @@ static struct net_device *register_vlan_device(const char *eth_IF_name,
out_free_unregister:
unregister_netdev(new_dev);
goto out_put_dev;
goto out_unlock;
out_free_newdev:
free_netdev(new_dev);
......
......@@ -1250,7 +1250,7 @@ static struct net_protocol ipgre_protocol = {
static int __init ipgre_init(void)
{
int err = -EINVAL;
int err;
printk(KERN_INFO "GRE over IPv4 tunneling driver\n");
......@@ -1263,18 +1263,19 @@ static int __init ipgre_init(void)
ipgre_tunnel_setup);
if (!ipgre_fb_tunnel_dev) {
err = -ENOMEM;
goto fail;
goto err1;
}
ipgre_fb_tunnel_dev->init = ipgre_fb_tunnel_init;
if ((err = register_netdev(ipgre_fb_tunnel_dev)))
goto fail;
goto err2;
out:
return err;
fail:
inet_del_protocol(&ipgre_protocol, IPPROTO_GRE);
err2:
free_netdev(ipgre_fb_tunnel_dev);
err1:
inet_del_protocol(&ipgre_protocol, IPPROTO_GRE);
goto out;
}
......
......@@ -246,7 +246,6 @@ static struct ip_tunnel * ipip_tunnel_locate(struct ip_tunnel_parm *parms, int c
nt = dev->priv;
SET_MODULE_OWNER(dev);
dev->init = ipip_tunnel_init;
dev->destructor = free_netdev;
nt->parms = *parms;
if (register_netdevice(dev) < 0) {
......@@ -784,6 +783,7 @@ static void ipip_tunnel_setup(struct net_device *dev)
dev->get_stats = ipip_tunnel_get_stats;
dev->do_ioctl = ipip_tunnel_ioctl;
dev->change_mtu = ipip_tunnel_change_mtu;
dev->destructor = free_netdev;
dev->type = ARPHRD_TUNNEL;
dev->hard_header_len = LL_MAX_HEADER + sizeof(struct iphdr);
......@@ -876,18 +876,19 @@ static int __init ipip_init(void)
ipip_tunnel_setup);
if (!ipip_fb_tunnel_dev) {
err = -ENOMEM;
goto fail;
goto err1;
}
ipip_fb_tunnel_dev->init = ipip_fb_tunnel_init;
if ((err = register_netdev(ipip_fb_tunnel_dev)))
goto fail;
goto err2;
out:
return err;
fail:
xfrm4_tunnel_deregister(&ipip_handler);
err2:
free_netdev(ipip_fb_tunnel_dev);
err1:
xfrm4_tunnel_deregister(&ipip_handler);
goto out;
}
......
......@@ -814,18 +814,19 @@ int __init sit_init(void)
ipip6_tunnel_setup);
if (!ipip6_fb_tunnel_dev) {
err = -ENOMEM;
goto fail;
goto err1;
}
ipip6_fb_tunnel_dev->init = ipip6_fb_tunnel_init;
if ((err = register_netdev(ipip6_fb_tunnel_dev)))
goto fail;
goto err2;
out:
return err;
fail:
inet_del_protocol(&sit_protocol, IPPROTO_IPV6);
err2:
free_netdev(ipip6_fb_tunnel_dev);
err1:
inet_del_protocol(&sit_protocol, IPPROTO_IPV6);
goto out;
}
......@@ -139,7 +139,7 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
struct tcf_proto_ops *tp_ops;
struct Qdisc_class_ops *cops;
unsigned long cl = 0;
unsigned long fh, fh_s;
unsigned long fh;
int err;
if (prio == 0) {
......@@ -231,8 +231,12 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
tp->classify = tp_ops->classify;
tp->classid = parent;
err = -EBUSY;
if (!try_module_get(tp_ops->owner) ||
(err = tp_ops->init(tp)) != 0) {
if (!try_module_get(tp_ops->owner)) {
kfree(tp);
goto errout;
}
if ((err = tp_ops->init(tp)) != 0) {
module_put(tp_ops->owner);
kfree(tp);
goto errout;
}
......@@ -245,7 +249,7 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
} else if (tca[TCA_KIND-1] && rtattr_strcmp(tca[TCA_KIND-1], tp->ops->kind))
goto errout;
fh_s = fh = tp->ops->get(tp, t->tcm_handle);
fh = tp->ops->get(tp, t->tcm_handle);
if (fh == 0) {
if (n->nlmsg_type == RTM_DELTFILTER && t->tcm_handle == 0) {
......@@ -253,7 +257,7 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
*back = tp->next;
qdisc_unlock_tree(dev);
tfilter_notify(skb, n, tp, fh_s, RTM_DELTFILTER);
tfilter_notify(skb, n, tp, fh, RTM_DELTFILTER);
tcf_destroy(tp);
err = 0;
goto errout;
......@@ -272,7 +276,7 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
case RTM_DELTFILTER:
err = tp->ops->delete(tp, fh);
if (err == 0)
tfilter_notify(skb, n, tp, fh_s, RTM_DELTFILTER);
tfilter_notify(skb, n, tp, fh, RTM_DELTFILTER);
goto errout;
case RTM_GETTFILTER:
err = tfilter_notify(skb, n, tp, fh, RTM_NEWTFILTER);
......
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