diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-28 23:03:42 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-28 23:03:42 -0700 |
commit | 3dcbbcda7c5b77c400791b26facd6593c5b176e0 (patch) | |
tree | 2e7b844c4d450cf43810a6ed0ddd5c702c245a88 /net/irda/af_irda.c | |
parent | c972398b7871d9fb58c6a317786065a7cc6ca4be (diff) | |
parent | 6fbe59b9569b2c8d5522d182263935c6c86fc40a (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: (160 commits)
[ETHTOOL]: Remove some entries from non-root command list.
[Bluetooth]: Fix section mismatch of bt_sysfs_cleanup()
[Bluetooth]: Don't update disconnect timer for incoming connections
[ETHTOOL]: let mortals use ethtool
[NetLabel]: add audit support for configuration changes
[TCP]: Fix and simplify microsecond rtt sampling
[TCP] tcp-lp: prevent chance for oops
[SUNRPC]: Remove unnecessary check in net/sunrpc/svcsock.c
[IPVS] bug: endianness breakage in ip_vs_ftp
[IPVS]: ipvs annotations
[NETFILTER]: h323 annotations
[NETFILTER]: ipt annotations
[NETFILTER]: NAT annotations
[NETFILTER]: conntrack annotations
[NETFILTER]: netfilter misc annotations
[NET]: Annotate dst_ops protocol
[NET]: is it Andy or Andi ??
[IPVS]: Make sure ip_vs_ftp ports are valid: module_param_array approach
[IPVS]: Reverse valid ip_vs_ftp ports fix: port check approach
[IrDA] stir4200: removing undocumented bits handling
...
Diffstat (limited to 'net/irda/af_irda.c')
-rw-r--r-- | net/irda/af_irda.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c index 17699eeb64d..7e1aea89ef0 100644 --- a/net/irda/af_irda.c +++ b/net/irda/af_irda.c @@ -132,13 +132,14 @@ static void irda_disconnect_indication(void *instance, void *sap, /* Prevent race conditions with irda_release() and irda_shutdown() */ if (!sock_flag(sk, SOCK_DEAD) && sk->sk_state != TCP_CLOSE) { + lock_sock(sk); sk->sk_state = TCP_CLOSE; sk->sk_err = ECONNRESET; sk->sk_shutdown |= SEND_SHUTDOWN; sk->sk_state_change(sk); - /* Uh-oh... Should use sock_orphan ? */ - sock_set_flag(sk, SOCK_DEAD); + sock_orphan(sk); + release_sock(sk); /* Close our TSAP. * If we leave it open, IrLMP put it back into the list of @@ -308,7 +309,8 @@ static void irda_connect_response(struct irda_sock *self) IRDA_ASSERT(self != NULL, return;); - skb = alloc_skb(64, GFP_ATOMIC); + skb = alloc_skb(TTP_MAX_HEADER + TTP_SAR_HEADER, + GFP_ATOMIC); if (skb == NULL) { IRDA_DEBUG(0, "%s() Unable to allocate sk_buff!\n", __FUNCTION__); @@ -1212,6 +1214,7 @@ static int irda_release(struct socket *sock) if (sk == NULL) return 0; + lock_sock(sk); sk->sk_state = TCP_CLOSE; sk->sk_shutdown |= SEND_SHUTDOWN; sk->sk_state_change(sk); @@ -1221,6 +1224,7 @@ static int irda_release(struct socket *sock) sock_orphan(sk); sock->sk = NULL; + release_sock(sk); /* Purge queues (see sock_init_data()) */ skb_queue_purge(&sk->sk_receive_queue); @@ -1353,6 +1357,7 @@ static int irda_recvmsg_dgram(struct kiocb *iocb, struct socket *sock, IRDA_DEBUG(4, "%s()\n", __FUNCTION__); IRDA_ASSERT(self != NULL, return -1;); + IRDA_ASSERT(!sock_error(sk), return -1;); skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT, flags & MSG_DONTWAIT, &err); @@ -1405,6 +1410,7 @@ static int irda_recvmsg_stream(struct kiocb *iocb, struct socket *sock, IRDA_DEBUG(3, "%s()\n", __FUNCTION__); IRDA_ASSERT(self != NULL, return -1;); + IRDA_ASSERT(!sock_error(sk), return -1;); if (sock->flags & __SO_ACCEPTCON) return(-EINVAL); |