aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-08 14:40:19 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-08 14:40:19 -0400
commit392eaef2e9f8e6527043ad8422d9cfea59ee6fb0 (patch)
treeeaea109bceaa7f62db1dd82d8844197363f578c8
parent85ba94ba0592296053f7f2846812173424afe1cb (diff)
parent9d2c27e17b7574023b5adb5c6a50d7aaeb915543 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: tcp: Fix tcp_hybla zero congestion window growth with small rho and large cwnd. net: Fix netdev_run_todo dead-lock tcp: Fix possible double-ack w/ user dma net: only invoke dev->change_rx_flags when device is UP netrom: Fix sock_orphan() use in nr_release ax25: Quick fix for making sure unaccepted sockets get destroyed. Revert "ax25: Fix std timer socket destroy handling." [Bluetooth] Add reset quirk for A-Link BlueUSB21 dongle [Bluetooth] Add reset quirk for new Targus and Belkin dongles [Bluetooth] Fix double frees on error paths of btusb and bpa10x drivers
-rw-r--r--drivers/bluetooth/bpa10x.c2
-rw-r--r--drivers/bluetooth/btusb.c8
-rw-r--r--net/ax25/af_ax25.c3
-rw-r--r--net/ax25/ax25_std_timer.c8
-rw-r--r--net/core/dev.c43
-rw-r--r--net/core/rtnetlink.c2
-rw-r--r--net/ipv4/tcp_hybla.c6
-rw-r--r--net/ipv4/tcp_input.c3
-rw-r--r--net/netrom/af_netrom.c2
9 files changed, 38 insertions, 39 deletions
diff --git a/drivers/bluetooth/bpa10x.c b/drivers/bluetooth/bpa10x.c
index 1e55a658e6c..32f3a8ed8d3 100644
--- a/drivers/bluetooth/bpa10x.c
+++ b/drivers/bluetooth/bpa10x.c
@@ -256,7 +256,6 @@ static inline int bpa10x_submit_intr_urb(struct hci_dev *hdev)
256 BT_ERR("%s urb %p submission failed (%d)", 256 BT_ERR("%s urb %p submission failed (%d)",
257 hdev->name, urb, -err); 257 hdev->name, urb, -err);
258 usb_unanchor_urb(urb); 258 usb_unanchor_urb(urb);
259 kfree(buf);
260 } 259 }
261 260
262 usb_free_urb(urb); 261 usb_free_urb(urb);
@@ -298,7 +297,6 @@ static inline int bpa10x_submit_bulk_urb(struct hci_dev *hdev)
298 BT_ERR("%s urb %p submission failed (%d)", 297 BT_ERR("%s urb %p submission failed (%d)",
299 hdev->name, urb, -err); 298 hdev->name, urb, -err);
300 usb_unanchor_urb(urb); 299 usb_unanchor_urb(urb);
301 kfree(buf);
302 } 300 }
303 301
304 usb_free_urb(urb); 302 usb_free_urb(urb);
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 29ae99817c6..af472e05273 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -102,6 +102,7 @@ static struct usb_device_id blacklist_table[] = {
102 { USB_DEVICE(0x0a5c, 0x2101), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU }, 102 { USB_DEVICE(0x0a5c, 0x2101), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU },
103 103
104 /* Broadcom BCM2046 */ 104 /* Broadcom BCM2046 */
105 { USB_DEVICE(0x0a5c, 0x2146), .driver_info = BTUSB_RESET },
105 { USB_DEVICE(0x0a5c, 0x2151), .driver_info = BTUSB_RESET }, 106 { USB_DEVICE(0x0a5c, 0x2151), .driver_info = BTUSB_RESET },
106 107
107 /* Apple MacBook Pro with Broadcom chip */ 108 /* Apple MacBook Pro with Broadcom chip */
@@ -113,6 +114,7 @@ static struct usb_device_id blacklist_table[] = {
113 114
114 /* Targus ACB10US */ 115 /* Targus ACB10US */
115 { USB_DEVICE(0x0a5c, 0x2100), .driver_info = BTUSB_RESET }, 116 { USB_DEVICE(0x0a5c, 0x2100), .driver_info = BTUSB_RESET },
117 { USB_DEVICE(0x0a5c, 0x2154), .driver_info = BTUSB_RESET },
116 118
117 /* ANYCOM Bluetooth USB-200 and USB-250 */ 119 /* ANYCOM Bluetooth USB-200 and USB-250 */
118 { USB_DEVICE(0x0a5c, 0x2111), .driver_info = BTUSB_RESET }, 120 { USB_DEVICE(0x0a5c, 0x2111), .driver_info = BTUSB_RESET },
@@ -150,6 +152,9 @@ static struct usb_device_id blacklist_table[] = {
150 { USB_DEVICE(0x050d, 0x0012), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU }, 152 { USB_DEVICE(0x050d, 0x0012), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU },
151 { USB_DEVICE(0x050d, 0x0013), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU }, 153 { USB_DEVICE(0x050d, 0x0013), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU },
152 154
155 /* Belkin F8T016 device */
156 { USB_DEVICE(0x050d, 0x016a), .driver_info = BTUSB_RESET },
157
153 /* Digianswer devices */ 158 /* Digianswer devices */
154 { USB_DEVICE(0x08fd, 0x0001), .driver_info = BTUSB_DIGIANSWER }, 159 { USB_DEVICE(0x08fd, 0x0001), .driver_info = BTUSB_DIGIANSWER },
155 { USB_DEVICE(0x08fd, 0x0002), .driver_info = BTUSB_IGNORE }, 160 { USB_DEVICE(0x08fd, 0x0002), .driver_info = BTUSB_IGNORE },
@@ -271,7 +276,6 @@ static int btusb_submit_intr_urb(struct hci_dev *hdev)
271 BT_ERR("%s urb %p submission failed (%d)", 276 BT_ERR("%s urb %p submission failed (%d)",
272 hdev->name, urb, -err); 277 hdev->name, urb, -err);
273 usb_unanchor_urb(urb); 278 usb_unanchor_urb(urb);
274 kfree(buf);
275 } 279 }
276 280
277 usb_free_urb(urb); 281 usb_free_urb(urb);
@@ -354,7 +358,6 @@ static int btusb_submit_bulk_urb(struct hci_dev *hdev)
354 BT_ERR("%s urb %p submission failed (%d)", 358 BT_ERR("%s urb %p submission failed (%d)",
355 hdev->name, urb, -err); 359 hdev->name, urb, -err);
356 usb_unanchor_urb(urb); 360 usb_unanchor_urb(urb);
357 kfree(buf);
358 } 361 }
359 362
360 usb_free_urb(urb); 363 usb_free_urb(urb);
@@ -475,7 +478,6 @@ static int btusb_submit_isoc_urb(struct hci_dev *hdev)
475 BT_ERR("%s urb %p submission failed (%d)", 478 BT_ERR("%s urb %p submission failed (%d)",
476 hdev->name, urb, -err); 479 hdev->name, urb, -err);
477 usb_unanchor_urb(urb); 480 usb_unanchor_urb(urb);
478 kfree(buf);
479 } 481 }
480 482
481 usb_free_urb(urb); 483 usb_free_urb(urb);
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
index 01c83e2a4c1..28c71574a78 100644
--- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c
@@ -317,6 +317,9 @@ void ax25_destroy_socket(ax25_cb *ax25)
317 /* Queue the unaccepted socket for death */ 317 /* Queue the unaccepted socket for death */
318 sock_orphan(skb->sk); 318 sock_orphan(skb->sk);
319 319
320 /* 9A4GL: hack to release unaccepted sockets */
321 skb->sk->sk_state = TCP_LISTEN;
322
320 ax25_start_heartbeat(sax25); 323 ax25_start_heartbeat(sax25);
321 sax25->state = AX25_STATE_0; 324 sax25->state = AX25_STATE_0;
322 } 325 }
diff --git a/net/ax25/ax25_std_timer.c b/net/ax25/ax25_std_timer.c
index cdc7e751ef3..96e4b927325 100644
--- a/net/ax25/ax25_std_timer.c
+++ b/net/ax25/ax25_std_timer.c
@@ -39,9 +39,11 @@ void ax25_std_heartbeat_expiry(ax25_cb *ax25)
39 39
40 switch (ax25->state) { 40 switch (ax25->state) {
41 case AX25_STATE_0: 41 case AX25_STATE_0:
42 if (!sk || 42 /* Magic here: If we listen() and a new link dies before it
43 sock_flag(sk, SOCK_DESTROY) || 43 is accepted() it isn't 'dead' so doesn't get removed. */
44 sock_flag(sk, SOCK_DEAD)) { 44 if (!sk || sock_flag(sk, SOCK_DESTROY) ||
45 (sk->sk_state == TCP_LISTEN &&
46 sock_flag(sk, SOCK_DEAD))) {
45 if (sk) { 47 if (sk) {
46 sock_hold(sk); 48 sock_hold(sk);
47 ax25_destroy_socket(ax25); 49 ax25_destroy_socket(ax25);
diff --git a/net/core/dev.c b/net/core/dev.c
index e8eb2b47834..0ae08d3f57e 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2918,6 +2918,12 @@ int netdev_set_master(struct net_device *slave, struct net_device *master)
2918 return 0; 2918 return 0;
2919} 2919}
2920 2920
2921static void dev_change_rx_flags(struct net_device *dev, int flags)
2922{
2923 if (dev->flags & IFF_UP && dev->change_rx_flags)
2924 dev->change_rx_flags(dev, flags);
2925}
2926
2921static int __dev_set_promiscuity(struct net_device *dev, int inc) 2927static int __dev_set_promiscuity(struct net_device *dev, int inc)
2922{ 2928{
2923 unsigned short old_flags = dev->flags; 2929 unsigned short old_flags = dev->flags;
@@ -2955,8 +2961,7 @@ static int __dev_set_promiscuity(struct net_device *dev, int inc)
2955 current->uid, current->gid, 2961 current->uid, current->gid,
2956 audit_get_sessionid(current)); 2962 audit_get_sessionid(current));
2957 2963
2958 if (dev->change_rx_flags) 2964 dev_change_rx_flags(dev, IFF_PROMISC);
2959 dev->change_rx_flags(dev, IFF_PROMISC);
2960 } 2965 }
2961 return 0; 2966 return 0;
2962} 2967}
@@ -3022,8 +3027,7 @@ int dev_set_allmulti(struct net_device *dev, int inc)
3022 } 3027 }
3023 } 3028 }
3024 if (dev->flags ^ old_flags) { 3029 if (dev->flags ^ old_flags) {
3025 if (dev->change_rx_flags) 3030 dev_change_rx_flags(dev, IFF_ALLMULTI);
3026 dev->change_rx_flags(dev, IFF_ALLMULTI);
3027 dev_set_rx_mode(dev); 3031 dev_set_rx_mode(dev);
3028 } 3032 }
3029 return 0; 3033 return 0;
@@ -3347,8 +3351,8 @@ int dev_change_flags(struct net_device *dev, unsigned flags)
3347 * Load in the correct multicast list now the flags have changed. 3351 * Load in the correct multicast list now the flags have changed.
3348 */ 3352 */
3349 3353
3350 if (dev->change_rx_flags && (old_flags ^ flags) & IFF_MULTICAST) 3354 if ((old_flags ^ flags) & IFF_MULTICAST)
3351 dev->change_rx_flags(dev, IFF_MULTICAST); 3355 dev_change_rx_flags(dev, IFF_MULTICAST);
3352 3356
3353 dev_set_rx_mode(dev); 3357 dev_set_rx_mode(dev);
3354 3358
@@ -3808,14 +3812,11 @@ static int dev_new_index(struct net *net)
3808} 3812}
3809 3813
3810/* Delayed registration/unregisteration */ 3814/* Delayed registration/unregisteration */
3811static DEFINE_SPINLOCK(net_todo_list_lock);
3812static LIST_HEAD(net_todo_list); 3815static LIST_HEAD(net_todo_list);
3813 3816
3814static void net_set_todo(struct net_device *dev) 3817static void net_set_todo(struct net_device *dev)
3815{ 3818{
3816 spin_lock(&net_todo_list_lock);
3817 list_add_tail(&dev->todo_list, &net_todo_list); 3819 list_add_tail(&dev->todo_list, &net_todo_list);
3818 spin_unlock(&net_todo_list_lock);
3819} 3820}
3820 3821
3821static void rollback_registered(struct net_device *dev) 3822static void rollback_registered(struct net_device *dev)
@@ -4142,33 +4143,24 @@ static void netdev_wait_allrefs(struct net_device *dev)
4142 * free_netdev(y1); 4143 * free_netdev(y1);
4143 * free_netdev(y2); 4144 * free_netdev(y2);
4144 * 4145 *
4145 * We are invoked by rtnl_unlock() after it drops the semaphore. 4146 * We are invoked by rtnl_unlock().
4146 * This allows us to deal with problems: 4147 * This allows us to deal with problems:
4147 * 1) We can delete sysfs objects which invoke hotplug 4148 * 1) We can delete sysfs objects which invoke hotplug
4148 * without deadlocking with linkwatch via keventd. 4149 * without deadlocking with linkwatch via keventd.
4149 * 2) Since we run with the RTNL semaphore not held, we can sleep 4150 * 2) Since we run with the RTNL semaphore not held, we can sleep
4150 * safely in order to wait for the netdev refcnt to drop to zero. 4151 * safely in order to wait for the netdev refcnt to drop to zero.
4152 *
4153 * We must not return until all unregister events added during
4154 * the interval the lock was held have been completed.
4151 */ 4155 */
4152static DEFINE_MUTEX(net_todo_run_mutex);
4153void netdev_run_todo(void) 4156void netdev_run_todo(void)
4154{ 4157{
4155 struct list_head list; 4158 struct list_head list;
4156 4159
4157 /* Need to guard against multiple cpu's getting out of order. */
4158 mutex_lock(&net_todo_run_mutex);
4159
4160 /* Not safe to do outside the semaphore. We must not return
4161 * until all unregister events invoked by the local processor
4162 * have been completed (either by this todo run, or one on
4163 * another cpu).
4164 */
4165 if (list_empty(&net_todo_list))
4166 goto out;
4167
4168 /* Snapshot list, allow later requests */ 4160 /* Snapshot list, allow later requests */
4169 spin_lock(&net_todo_list_lock);
4170 list_replace_init(&net_todo_list, &list); 4161 list_replace_init(&net_todo_list, &list);
4171 spin_unlock(&net_todo_list_lock); 4162
4163 __rtnl_unlock();
4172 4164
4173 while (!list_empty(&list)) { 4165 while (!list_empty(&list)) {
4174 struct net_device *dev 4166 struct net_device *dev
@@ -4200,9 +4192,6 @@ void netdev_run_todo(void)
4200 /* Free network device */ 4192 /* Free network device */
4201 kobject_put(&dev->dev.kobj); 4193 kobject_put(&dev->dev.kobj);
4202 } 4194 }
4203
4204out:
4205 mutex_unlock(&net_todo_run_mutex);
4206} 4195}
4207 4196
4208static struct net_device_stats *internal_stats(struct net_device *dev) 4197static struct net_device_stats *internal_stats(struct net_device *dev)
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 71edb8b3634..d6381c2a469 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -73,7 +73,7 @@ void __rtnl_unlock(void)
73 73
74void rtnl_unlock(void) 74void rtnl_unlock(void)
75{ 75{
76 mutex_unlock(&rtnl_mutex); 76 /* This fellow will unlock it for us. */
77 netdev_run_todo(); 77 netdev_run_todo();
78} 78}
79 79
diff --git a/net/ipv4/tcp_hybla.c b/net/ipv4/tcp_hybla.c
index bfcbd148a89..c209e054a63 100644
--- a/net/ipv4/tcp_hybla.c
+++ b/net/ipv4/tcp_hybla.c
@@ -150,7 +150,11 @@ static void hybla_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
150 ca->snd_cwnd_cents -= 128; 150 ca->snd_cwnd_cents -= 128;
151 tp->snd_cwnd_cnt = 0; 151 tp->snd_cwnd_cnt = 0;
152 } 152 }
153 153 /* check when cwnd has not been incremented for a while */
154 if (increment == 0 && odd == 0 && tp->snd_cwnd_cnt >= tp->snd_cwnd) {
155 tp->snd_cwnd++;
156 tp->snd_cwnd_cnt = 0;
157 }
154 /* clamp down slowstart cwnd to ssthresh value. */ 158 /* clamp down slowstart cwnd to ssthresh value. */
155 if (is_slowstart) 159 if (is_slowstart)
156 tp->snd_cwnd = min(tp->snd_cwnd, tp->snd_ssthresh); 160 tp->snd_cwnd = min(tp->snd_cwnd, tp->snd_ssthresh);
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 67ccce2a96b..7abc6b80d47 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4879,7 +4879,8 @@ int tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
4879 goto no_ack; 4879 goto no_ack;
4880 } 4880 }
4881 4881
4882 __tcp_ack_snd_check(sk, 0); 4882 if (!copied_early || tp->rcv_nxt != tp->rcv_wup)
4883 __tcp_ack_snd_check(sk, 0);
4883no_ack: 4884no_ack:
4884#ifdef CONFIG_NET_DMA 4885#ifdef CONFIG_NET_DMA
4885 if (copied_early) 4886 if (copied_early)
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c
index 532e4faa29f..9f1ea4a27b3 100644
--- a/net/netrom/af_netrom.c
+++ b/net/netrom/af_netrom.c
@@ -525,6 +525,7 @@ static int nr_release(struct socket *sock)
525 if (sk == NULL) return 0; 525 if (sk == NULL) return 0;
526 526
527 sock_hold(sk); 527 sock_hold(sk);
528 sock_orphan(sk);
528 lock_sock(sk); 529 lock_sock(sk);
529 nr = nr_sk(sk); 530 nr = nr_sk(sk);
530 531
@@ -548,7 +549,6 @@ static int nr_release(struct socket *sock)
548 sk->sk_state = TCP_CLOSE; 549 sk->sk_state = TCP_CLOSE;
549 sk->sk_shutdown |= SEND_SHUTDOWN; 550 sk->sk_shutdown |= SEND_SHUTDOWN;
550 sk->sk_state_change(sk); 551 sk->sk_state_change(sk);
551 sock_orphan(sk);
552 sock_set_flag(sk, SOCK_DESTROY); 552 sock_set_flag(sk, SOCK_DESTROY);
553 break; 553 break;
554 554