diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-05 19:59:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-05 19:59:46 -0400 |
commit | ff3ea47c623276e9772cbc268471224648d5a7fe (patch) | |
tree | ecb77b11659f85abefed71aa075d4f879a7cc116 | |
parent | a8c725045eb2eaa6c28a5493cb193f47a5c4afe4 (diff) | |
parent | 36485707bbd9729e0c52315b173aeed9bc2303dd (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
[BRIDGE]: fix locking and memory leak in br_add_bridge
[IRDA]: Missing allocation result check in irlap_change_speed().
[PPPOE]: Missing result check in __pppoe_xmit().
[NET]: Eliminate unused /proc/sys/net/ethernet
[NETCONSOLE]: Clean up initcall warning.
[TCP]: Avoid skb_pull if possible when trimming head
-rw-r--r-- | drivers/net/netconsole.c | 2 | ||||
-rw-r--r-- | drivers/net/pppoe.c | 3 | ||||
-rw-r--r-- | net/bridge/br_if.c | 19 | ||||
-rw-r--r-- | net/ethernet/Makefile | 1 | ||||
-rw-r--r-- | net/ethernet/sysctl_net_ether.c | 14 | ||||
-rw-r--r-- | net/ipv4/tcp_output.c | 12 | ||||
-rw-r--r-- | net/irda/irlap.c | 3 | ||||
-rw-r--r-- | net/sysctl_net.c | 8 |
8 files changed, 18 insertions, 44 deletions
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index 66e74f740261..bf58db29e2ed 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c | |||
@@ -107,7 +107,7 @@ static int init_netconsole(void) | |||
107 | 107 | ||
108 | if(!configured) { | 108 | if(!configured) { |
109 | printk("netconsole: not configured, aborting\n"); | 109 | printk("netconsole: not configured, aborting\n"); |
110 | return -EINVAL; | 110 | return 0; |
111 | } | 111 | } |
112 | 112 | ||
113 | if(netpoll_setup(&np)) | 113 | if(netpoll_setup(&np)) |
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c index 475dc930380f..0d101a18026a 100644 --- a/drivers/net/pppoe.c +++ b/drivers/net/pppoe.c | |||
@@ -861,6 +861,9 @@ static int __pppoe_xmit(struct sock *sk, struct sk_buff *skb) | |||
861 | * give dev_queue_xmit something it can free. | 861 | * give dev_queue_xmit something it can free. |
862 | */ | 862 | */ |
863 | skb2 = skb_clone(skb, GFP_ATOMIC); | 863 | skb2 = skb_clone(skb, GFP_ATOMIC); |
864 | |||
865 | if (skb2 == NULL) | ||
866 | goto abort; | ||
864 | } | 867 | } |
865 | 868 | ||
866 | ph = (struct pppoe_hdr *) skb_push(skb2, sizeof(struct pppoe_hdr)); | 869 | ph = (struct pppoe_hdr *) skb_push(skb2, sizeof(struct pppoe_hdr)); |
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index ad1c7af65ec8..f5d47bf4f967 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c | |||
@@ -300,25 +300,20 @@ int br_add_bridge(const char *name) | |||
300 | rtnl_lock(); | 300 | rtnl_lock(); |
301 | if (strchr(dev->name, '%')) { | 301 | if (strchr(dev->name, '%')) { |
302 | ret = dev_alloc_name(dev, dev->name); | 302 | ret = dev_alloc_name(dev, dev->name); |
303 | if (ret < 0) | 303 | if (ret < 0) { |
304 | goto err1; | 304 | free_netdev(dev); |
305 | goto out; | ||
306 | } | ||
305 | } | 307 | } |
306 | 308 | ||
307 | ret = register_netdevice(dev); | 309 | ret = register_netdevice(dev); |
308 | if (ret) | 310 | if (ret) |
309 | goto err2; | 311 | goto out; |
310 | 312 | ||
311 | ret = br_sysfs_addbr(dev); | 313 | ret = br_sysfs_addbr(dev); |
312 | if (ret) | 314 | if (ret) |
313 | goto err3; | 315 | unregister_netdevice(dev); |
314 | rtnl_unlock(); | 316 | out: |
315 | return 0; | ||
316 | |||
317 | err3: | ||
318 | unregister_netdev(dev); | ||
319 | err2: | ||
320 | free_netdev(dev); | ||
321 | err1: | ||
322 | rtnl_unlock(); | 317 | rtnl_unlock(); |
323 | return ret; | 318 | return ret; |
324 | } | 319 | } |
diff --git a/net/ethernet/Makefile b/net/ethernet/Makefile index 69b74a9a0fc3..7cef1d8ace27 100644 --- a/net/ethernet/Makefile +++ b/net/ethernet/Makefile | |||
@@ -3,6 +3,5 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | obj-y += eth.o | 5 | obj-y += eth.o |
6 | obj-$(CONFIG_SYSCTL) += sysctl_net_ether.o | ||
7 | obj-$(subst m,y,$(CONFIG_IPX)) += pe2.o | 6 | obj-$(subst m,y,$(CONFIG_IPX)) += pe2.o |
8 | obj-$(subst m,y,$(CONFIG_ATALK)) += pe2.o | 7 | obj-$(subst m,y,$(CONFIG_ATALK)) += pe2.o |
diff --git a/net/ethernet/sysctl_net_ether.c b/net/ethernet/sysctl_net_ether.c deleted file mode 100644 index 66b39fc342d2..000000000000 --- a/net/ethernet/sysctl_net_ether.c +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | /* -*- linux-c -*- | ||
2 | * sysctl_net_ether.c: sysctl interface to net Ethernet subsystem. | ||
3 | * | ||
4 | * Begun April 1, 1996, Mike Shaver. | ||
5 | * Added /proc/sys/net/ether directory entry (empty =) ). [MS] | ||
6 | */ | ||
7 | |||
8 | #include <linux/mm.h> | ||
9 | #include <linux/sysctl.h> | ||
10 | #include <linux/if_ether.h> | ||
11 | |||
12 | ctl_table ether_table[] = { | ||
13 | {0} | ||
14 | }; | ||
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 743016baa048..f33c9dddaa12 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -642,7 +642,7 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, unsigned int mss | |||
642 | * eventually). The difference is that pulled data not copied, but | 642 | * eventually). The difference is that pulled data not copied, but |
643 | * immediately discarded. | 643 | * immediately discarded. |
644 | */ | 644 | */ |
645 | static unsigned char *__pskb_trim_head(struct sk_buff *skb, int len) | 645 | static void __pskb_trim_head(struct sk_buff *skb, int len) |
646 | { | 646 | { |
647 | int i, k, eat; | 647 | int i, k, eat; |
648 | 648 | ||
@@ -667,7 +667,6 @@ static unsigned char *__pskb_trim_head(struct sk_buff *skb, int len) | |||
667 | skb->tail = skb->data; | 667 | skb->tail = skb->data; |
668 | skb->data_len -= len; | 668 | skb->data_len -= len; |
669 | skb->len = skb->data_len; | 669 | skb->len = skb->data_len; |
670 | return skb->tail; | ||
671 | } | 670 | } |
672 | 671 | ||
673 | int tcp_trim_head(struct sock *sk, struct sk_buff *skb, u32 len) | 672 | int tcp_trim_head(struct sock *sk, struct sk_buff *skb, u32 len) |
@@ -676,12 +675,11 @@ int tcp_trim_head(struct sock *sk, struct sk_buff *skb, u32 len) | |||
676 | pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) | 675 | pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) |
677 | return -ENOMEM; | 676 | return -ENOMEM; |
678 | 677 | ||
679 | if (len <= skb_headlen(skb)) { | 678 | /* If len == headlen, we avoid __skb_pull to preserve alignment. */ |
679 | if (unlikely(len < skb_headlen(skb))) | ||
680 | __skb_pull(skb, len); | 680 | __skb_pull(skb, len); |
681 | } else { | 681 | else |
682 | if (__pskb_trim_head(skb, len-skb_headlen(skb)) == NULL) | 682 | __pskb_trim_head(skb, len - skb_headlen(skb)); |
683 | return -ENOMEM; | ||
684 | } | ||
685 | 683 | ||
686 | TCP_SKB_CB(skb)->seq += len; | 684 | TCP_SKB_CB(skb)->seq += len; |
687 | skb->ip_summed = CHECKSUM_HW; | 685 | skb->ip_summed = CHECKSUM_HW; |
diff --git a/net/irda/irlap.c b/net/irda/irlap.c index 7029618f5719..a16528657b4c 100644 --- a/net/irda/irlap.c +++ b/net/irda/irlap.c | |||
@@ -884,7 +884,8 @@ static void irlap_change_speed(struct irlap_cb *self, __u32 speed, int now) | |||
884 | if (now) { | 884 | if (now) { |
885 | /* Send down empty frame to trigger speed change */ | 885 | /* Send down empty frame to trigger speed change */ |
886 | skb = dev_alloc_skb(0); | 886 | skb = dev_alloc_skb(0); |
887 | irlap_queue_xmit(self, skb); | 887 | if (skb) |
888 | irlap_queue_xmit(self, skb); | ||
888 | } | 889 | } |
889 | } | 890 | } |
890 | 891 | ||
diff --git a/net/sysctl_net.c b/net/sysctl_net.c index 55538f6b60ff..58a1b6b42ddd 100644 --- a/net/sysctl_net.c +++ b/net/sysctl_net.c | |||
@@ -37,14 +37,6 @@ struct ctl_table net_table[] = { | |||
37 | .mode = 0555, | 37 | .mode = 0555, |
38 | .child = core_table, | 38 | .child = core_table, |
39 | }, | 39 | }, |
40 | #ifdef CONFIG_NET | ||
41 | { | ||
42 | .ctl_name = NET_ETHER, | ||
43 | .procname = "ethernet", | ||
44 | .mode = 0555, | ||
45 | .child = ether_table, | ||
46 | }, | ||
47 | #endif | ||
48 | #ifdef CONFIG_INET | 40 | #ifdef CONFIG_INET |
49 | { | 41 | { |
50 | .ctl_name = NET_IPV4, | 42 | .ctl_name = NET_IPV4, |