Skip to content

Commit

Permalink
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Linus Torvalds committed Jun 5, 2006
2 parents a8c7250 + 3648570 commit ff3ea47
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 44 deletions.
2 changes: 1 addition & 1 deletion drivers/net/netconsole.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ static int init_netconsole(void)

if(!configured) {
printk("netconsole: not configured, aborting\n");
return -EINVAL;
return 0;
}

if(netpoll_setup(&np))
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/pppoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,9 @@ static int __pppoe_xmit(struct sock *sk, struct sk_buff *skb)
* give dev_queue_xmit something it can free.
*/
skb2 = skb_clone(skb, GFP_ATOMIC);

if (skb2 == NULL)
goto abort;
}

ph = (struct pppoe_hdr *) skb_push(skb2, sizeof(struct pppoe_hdr));
Expand Down
19 changes: 7 additions & 12 deletions net/bridge/br_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,25 +300,20 @@ int br_add_bridge(const char *name)
rtnl_lock();
if (strchr(dev->name, '%')) {
ret = dev_alloc_name(dev, dev->name);
if (ret < 0)
goto err1;
if (ret < 0) {
free_netdev(dev);
goto out;
}
}

ret = register_netdevice(dev);
if (ret)
goto err2;
goto out;

ret = br_sysfs_addbr(dev);
if (ret)
goto err3;
rtnl_unlock();
return 0;

err3:
unregister_netdev(dev);
err2:
free_netdev(dev);
err1:
unregister_netdevice(dev);
out:
rtnl_unlock();
return ret;
}
Expand Down
1 change: 0 additions & 1 deletion net/ethernet/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
#

obj-y += eth.o
obj-$(CONFIG_SYSCTL) += sysctl_net_ether.o
obj-$(subst m,y,$(CONFIG_IPX)) += pe2.o
obj-$(subst m,y,$(CONFIG_ATALK)) += pe2.o
14 changes: 0 additions & 14 deletions net/ethernet/sysctl_net_ether.c

This file was deleted.

12 changes: 5 additions & 7 deletions net/ipv4/tcp_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, unsigned int mss
* eventually). The difference is that pulled data not copied, but
* immediately discarded.
*/
static unsigned char *__pskb_trim_head(struct sk_buff *skb, int len)
static void __pskb_trim_head(struct sk_buff *skb, int len)
{
int i, k, eat;

Expand All @@ -667,7 +667,6 @@ static unsigned char *__pskb_trim_head(struct sk_buff *skb, int len)
skb->tail = skb->data;
skb->data_len -= len;
skb->len = skb->data_len;
return skb->tail;
}

int tcp_trim_head(struct sock *sk, struct sk_buff *skb, u32 len)
Expand All @@ -676,12 +675,11 @@ int tcp_trim_head(struct sock *sk, struct sk_buff *skb, u32 len)
pskb_expand_head(skb, 0, 0, GFP_ATOMIC))
return -ENOMEM;

if (len <= skb_headlen(skb)) {
/* If len == headlen, we avoid __skb_pull to preserve alignment. */
if (unlikely(len < skb_headlen(skb)))
__skb_pull(skb, len);
} else {
if (__pskb_trim_head(skb, len-skb_headlen(skb)) == NULL)
return -ENOMEM;
}
else
__pskb_trim_head(skb, len - skb_headlen(skb));

TCP_SKB_CB(skb)->seq += len;
skb->ip_summed = CHECKSUM_HW;
Expand Down
3 changes: 2 additions & 1 deletion net/irda/irlap.c
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,8 @@ static void irlap_change_speed(struct irlap_cb *self, __u32 speed, int now)
if (now) {
/* Send down empty frame to trigger speed change */
skb = dev_alloc_skb(0);
irlap_queue_xmit(self, skb);
if (skb)
irlap_queue_xmit(self, skb);
}
}

Expand Down
8 changes: 0 additions & 8 deletions net/sysctl_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ struct ctl_table net_table[] = {
.mode = 0555,
.child = core_table,
},
#ifdef CONFIG_NET
{
.ctl_name = NET_ETHER,
.procname = "ethernet",
.mode = 0555,
.child = ether_table,
},
#endif
#ifdef CONFIG_INET
{
.ctl_name = NET_IPV4,
Expand Down

0 comments on commit ff3ea47

Please sign in to comment.