aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/atm/firestream.c15
-rw-r--r--drivers/net/tg3.c5
-rw-r--r--include/net/af_unix.h8
-rw-r--r--net/8021q/vlan.c3
-rw-r--r--net/core/sock.c2
-rw-r--r--net/dccp/probe.c2
-rw-r--r--net/ipv4/datagram.c6
-rw-r--r--net/ipv4/icmp.c15
-rw-r--r--net/ipv4/inet_connection_sock.c4
-rw-r--r--net/ipv4/tcp.c3
-rw-r--r--net/ipv4/tcp_input.c4
-rw-r--r--net/ipv4/tcp_ipv4.c5
-rw-r--r--net/ipv4/udp.c5
-rw-r--r--net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c3
-rw-r--r--net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c3
-rw-r--r--net/sched/act_pedit.c3
-rw-r--r--net/sched/sch_generic.c3
-rw-r--r--net/sctp/debug.c8
-rw-r--r--net/sctp/sm_statetable.c2
-rw-r--r--net/unix/af_unix.c127
-rw-r--r--net/wanrouter/wanmain.c2
21 files changed, 132 insertions, 96 deletions
diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c
index 9c67df5ccfa4..7f6d02ce1b5f 100644
--- a/drivers/atm/firestream.c
+++ b/drivers/atm/firestream.c
@@ -1475,6 +1475,7 @@ static void top_off_fp (struct fs_dev *dev, struct freepool *fp,
1475 struct FS_BPENTRY *qe, *ne; 1475 struct FS_BPENTRY *qe, *ne;
1476 struct sk_buff *skb; 1476 struct sk_buff *skb;
1477 int n = 0; 1477 int n = 0;
1478 u32 qe_tmp;
1478 1479
1479 fs_dprintk (FS_DEBUG_QUEUE, "Topping off queue at %x (%d-%d/%d)\n", 1480 fs_dprintk (FS_DEBUG_QUEUE, "Topping off queue at %x (%d-%d/%d)\n",
1480 fp->offset, read_fs (dev, FP_CNT (fp->offset)), fp->n, 1481 fp->offset, read_fs (dev, FP_CNT (fp->offset)), fp->n,
@@ -1502,10 +1503,16 @@ static void top_off_fp (struct fs_dev *dev, struct freepool *fp,
1502 ne->skb = skb; 1503 ne->skb = skb;
1503 ne->fp = fp; 1504 ne->fp = fp;
1504 1505
1505 qe = (struct FS_BPENTRY *) (read_fs (dev, FP_EA(fp->offset))); 1506 /*
1506 fs_dprintk (FS_DEBUG_QUEUE, "link at %p\n", qe); 1507 * FIXME: following code encodes and decodes
1507 if (qe) { 1508 * machine pointers (could be 64-bit) into a
1508 qe = bus_to_virt ((long) qe); 1509 * 32-bit register.
1510 */
1511
1512 qe_tmp = read_fs (dev, FP_EA(fp->offset));
1513 fs_dprintk (FS_DEBUG_QUEUE, "link at %x\n", qe_tmp);
1514 if (qe_tmp) {
1515 qe = bus_to_virt ((long) qe_tmp);
1509 qe->next = virt_to_bus(ne); 1516 qe->next = virt_to_bus(ne);
1510 qe->flags &= ~FP_FLAGS_EPI; 1517 qe->flags &= ~FP_FLAGS_EPI;
1511 } else 1518 } else
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 023779a581fd..2f3184184ad9 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -64,8 +64,8 @@
64 64
65#define DRV_MODULE_NAME "tg3" 65#define DRV_MODULE_NAME "tg3"
66#define PFX DRV_MODULE_NAME ": " 66#define PFX DRV_MODULE_NAME ": "
67#define DRV_MODULE_VERSION "3.76" 67#define DRV_MODULE_VERSION "3.77"
68#define DRV_MODULE_RELDATE "May 5, 2007" 68#define DRV_MODULE_RELDATE "May 31, 2007"
69 69
70#define TG3_DEF_MAC_MODE 0 70#define TG3_DEF_MAC_MODE 0
71#define TG3_DEF_RX_MODE 0 71#define TG3_DEF_RX_MODE 0
@@ -10961,6 +10961,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
10961 * upon subsystem IDs. 10961 * upon subsystem IDs.
10962 */ 10962 */
10963 if (tp->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL && 10963 if (tp->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL &&
10964 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701 &&
10964 !(tp->tg3_flags2 & TG3_FLG2_PHY_SERDES)) { 10965 !(tp->tg3_flags2 & TG3_FLG2_PHY_SERDES)) {
10965 tp->tg3_flags |= (TG3_FLAG_USE_MI_INTERRUPT | 10966 tp->tg3_flags |= (TG3_FLAG_USE_MI_INTERRUPT |
10966 TG3_FLAG_USE_LINKCHG_REG); 10967 TG3_FLAG_USE_LINKCHG_REG);
diff --git a/include/net/af_unix.h b/include/net/af_unix.h
index c0398f5a8cb9..65f49fd7deff 100644
--- a/include/net/af_unix.h
+++ b/include/net/af_unix.h
@@ -62,13 +62,11 @@ struct unix_skb_parms {
62#define UNIXCREDS(skb) (&UNIXCB((skb)).creds) 62#define UNIXCREDS(skb) (&UNIXCB((skb)).creds)
63#define UNIXSID(skb) (&UNIXCB((skb)).secid) 63#define UNIXSID(skb) (&UNIXCB((skb)).secid)
64 64
65#define unix_state_rlock(s) spin_lock(&unix_sk(s)->lock) 65#define unix_state_lock(s) spin_lock(&unix_sk(s)->lock)
66#define unix_state_runlock(s) spin_unlock(&unix_sk(s)->lock) 66#define unix_state_unlock(s) spin_unlock(&unix_sk(s)->lock)
67#define unix_state_wlock(s) spin_lock(&unix_sk(s)->lock) 67#define unix_state_lock_nested(s) \
68#define unix_state_wlock_nested(s) \
69 spin_lock_nested(&unix_sk(s)->lock, \ 68 spin_lock_nested(&unix_sk(s)->lock, \
70 SINGLE_DEPTH_NESTING) 69 SINGLE_DEPTH_NESTING)
71#define unix_state_wunlock(s) spin_unlock(&unix_sk(s)->lock)
72 70
73#ifdef __KERNEL__ 71#ifdef __KERNEL__
74/* The AF_UNIX socket */ 72/* The AF_UNIX socket */
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index ceef57c9ab32..de78c9dd713b 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -736,8 +736,7 @@ static int vlan_ioctl_handler(void __user *arg)
736 case SET_VLAN_NAME_TYPE_CMD: 736 case SET_VLAN_NAME_TYPE_CMD:
737 if (!capable(CAP_NET_ADMIN)) 737 if (!capable(CAP_NET_ADMIN))
738 return -EPERM; 738 return -EPERM;
739 if ((args.u.name_type >= 0) && 739 if (args.u.name_type < VLAN_NAME_TYPE_HIGHEST) {
740 (args.u.name_type < VLAN_NAME_TYPE_HIGHEST)) {
741 vlan_name_type = args.u.name_type; 740 vlan_name_type = args.u.name_type;
742 err = 0; 741 err = 0;
743 } else { 742 } else {
diff --git a/net/core/sock.c b/net/core/sock.c
index 7e51d3a5e4f6..c14ce0198d25 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -998,7 +998,7 @@ void sk_setup_caps(struct sock *sk, struct dst_entry *dst)
998 __sk_dst_set(sk, dst); 998 __sk_dst_set(sk, dst);
999 sk->sk_route_caps = dst->dev->features; 999 sk->sk_route_caps = dst->dev->features;
1000 if (sk->sk_route_caps & NETIF_F_GSO) 1000 if (sk->sk_route_caps & NETIF_F_GSO)
1001 sk->sk_route_caps |= NETIF_F_GSO_MASK; 1001 sk->sk_route_caps |= NETIF_F_GSO_SOFTWARE;
1002 if (sk_can_gso(sk)) { 1002 if (sk_can_gso(sk)) {
1003 if (dst->header_len) 1003 if (dst->header_len)
1004 sk->sk_route_caps &= ~NETIF_F_GSO_MASK; 1004 sk->sk_route_caps &= ~NETIF_F_GSO_MASK;
diff --git a/net/dccp/probe.c b/net/dccp/probe.c
index 1f5e3ba62065..43a3adb027e7 100644
--- a/net/dccp/probe.c
+++ b/net/dccp/probe.c
@@ -128,7 +128,7 @@ static ssize_t dccpprobe_read(struct file *file, char __user *buf,
128 int error = 0, cnt = 0; 128 int error = 0, cnt = 0;
129 unsigned char *tbuf; 129 unsigned char *tbuf;
130 130
131 if (!buf || len < 0) 131 if (!buf)
132 return -EINVAL; 132 return -EINVAL;
133 133
134 if (len == 0) 134 if (len == 0)
diff --git a/net/ipv4/datagram.c b/net/ipv4/datagram.c
index dd02a45d0f67..0301dd468cf4 100644
--- a/net/ipv4/datagram.c
+++ b/net/ipv4/datagram.c
@@ -50,8 +50,12 @@ int ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
50 RT_CONN_FLAGS(sk), oif, 50 RT_CONN_FLAGS(sk), oif,
51 sk->sk_protocol, 51 sk->sk_protocol,
52 inet->sport, usin->sin_port, sk, 1); 52 inet->sport, usin->sin_port, sk, 1);
53 if (err) 53 if (err) {
54 if (err == -ENETUNREACH)
55 IP_INC_STATS_BH(IPSTATS_MIB_OUTNOROUTES);
54 return err; 56 return err;
57 }
58
55 if ((rt->rt_flags & RTCF_BROADCAST) && !sock_flag(sk, SOCK_BROADCAST)) { 59 if ((rt->rt_flags & RTCF_BROADCAST) && !sock_flag(sk, SOCK_BROADCAST)) {
56 ip_rt_put(rt); 60 ip_rt_put(rt);
57 return -EACCES; 61 return -EACCES;
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index e238b17f554c..02a899bec196 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -514,12 +514,15 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
514 514
515 saddr = iph->daddr; 515 saddr = iph->daddr;
516 if (!(rt->rt_flags & RTCF_LOCAL)) { 516 if (!(rt->rt_flags & RTCF_LOCAL)) {
517 /* This is broken, skb_in->dev points to the outgoing device 517 struct net_device *dev = NULL;
518 * after the packet passes through ip_output(). 518
519 */ 519 if (rt->fl.iif && sysctl_icmp_errors_use_inbound_ifaddr)
520 if (skb_in->dev && sysctl_icmp_errors_use_inbound_ifaddr) 520 dev = dev_get_by_index(rt->fl.iif);
521 saddr = inet_select_addr(skb_in->dev, 0, RT_SCOPE_LINK); 521
522 else 522 if (dev) {
523 saddr = inet_select_addr(dev, 0, RT_SCOPE_LINK);
524 dev_put(dev);
525 } else
523 saddr = 0; 526 saddr = 0;
524 } 527 }
525 528
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index 43fb1600f1f0..fbe7714f21d0 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -31,10 +31,8 @@ EXPORT_SYMBOL(inet_csk_timer_bug_msg);
31 31
32/* 32/*
33 * This array holds the first and last local port number. 33 * This array holds the first and last local port number.
34 * For high-usage systems, use sysctl to change this to
35 * 32768-61000
36 */ 34 */
37int sysctl_local_port_range[2] = { 1024, 4999 }; 35int sysctl_local_port_range[2] = { 32768, 61000 };
38 36
39int inet_csk_bind_conflict(const struct sock *sk, 37int inet_csk_bind_conflict(const struct sock *sk,
40 const struct inet_bind_bucket *tb) 38 const struct inet_bind_bucket *tb)
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 766314505c09..cd3c7e95de9e 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2464,13 +2464,10 @@ void __init tcp_init(void)
2464 order++) 2464 order++)
2465 ; 2465 ;
2466 if (order >= 4) { 2466 if (order >= 4) {
2467 sysctl_local_port_range[0] = 32768;
2468 sysctl_local_port_range[1] = 61000;
2469 tcp_death_row.sysctl_max_tw_buckets = 180000; 2467 tcp_death_row.sysctl_max_tw_buckets = 180000;
2470 sysctl_tcp_max_orphans = 4096 << (order - 4); 2468 sysctl_tcp_max_orphans = 4096 << (order - 4);
2471 sysctl_max_syn_backlog = 1024; 2469 sysctl_max_syn_backlog = 1024;
2472 } else if (order < 3) { 2470 } else if (order < 3) {
2473 sysctl_local_port_range[0] = 1024 * (3 - order);
2474 tcp_death_row.sysctl_max_tw_buckets >>= (3 - order); 2471 tcp_death_row.sysctl_max_tw_buckets >>= (3 - order);
2475 sysctl_tcp_max_orphans >>= (3 - order); 2472 sysctl_tcp_max_orphans >>= (3 - order);
2476 sysctl_max_syn_backlog = 128; 2473 sysctl_max_syn_backlog = 128;
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 38cb25b48bf3..74683d81c3f1 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2407,8 +2407,8 @@ static int tcp_clean_rtx_queue(struct sock *sk, __s32 *seq_rtt_p)
2407 struct sk_buff *skb; 2407 struct sk_buff *skb;
2408 __u32 now = tcp_time_stamp; 2408 __u32 now = tcp_time_stamp;
2409 int acked = 0; 2409 int acked = 0;
2410 int prior_packets = tp->packets_out;
2410 __s32 seq_rtt = -1; 2411 __s32 seq_rtt = -1;
2411 u32 pkts_acked = 0;
2412 ktime_t last_ackt = ktime_set(0,0); 2412 ktime_t last_ackt = ktime_set(0,0);
2413 2413
2414 while ((skb = tcp_write_queue_head(sk)) && 2414 while ((skb = tcp_write_queue_head(sk)) &&
@@ -2437,7 +2437,6 @@ static int tcp_clean_rtx_queue(struct sock *sk, __s32 *seq_rtt_p)
2437 */ 2437 */
2438 if (!(scb->flags & TCPCB_FLAG_SYN)) { 2438 if (!(scb->flags & TCPCB_FLAG_SYN)) {
2439 acked |= FLAG_DATA_ACKED; 2439 acked |= FLAG_DATA_ACKED;
2440 ++pkts_acked;
2441 } else { 2440 } else {
2442 acked |= FLAG_SYN_ACKED; 2441 acked |= FLAG_SYN_ACKED;
2443 tp->retrans_stamp = 0; 2442 tp->retrans_stamp = 0;
@@ -2481,6 +2480,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, __s32 *seq_rtt_p)
2481 } 2480 }
2482 2481
2483 if (acked&FLAG_ACKED) { 2482 if (acked&FLAG_ACKED) {
2483 u32 pkts_acked = prior_packets - tp->packets_out;
2484 const struct tcp_congestion_ops *ca_ops 2484 const struct tcp_congestion_ops *ca_ops
2485 = inet_csk(sk)->icsk_ca_ops; 2485 = inet_csk(sk)->icsk_ca_ops;
2486 2486
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 5a3e7f839fc5..47c61055eb60 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -192,8 +192,11 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
192 RT_CONN_FLAGS(sk), sk->sk_bound_dev_if, 192 RT_CONN_FLAGS(sk), sk->sk_bound_dev_if,
193 IPPROTO_TCP, 193 IPPROTO_TCP,
194 inet->sport, usin->sin_port, sk, 1); 194 inet->sport, usin->sin_port, sk, 1);
195 if (tmp < 0) 195 if (tmp < 0) {
196 if (tmp == -ENETUNREACH)
197 IP_INC_STATS_BH(IPSTATS_MIB_OUTNOROUTES);
196 return tmp; 198 return tmp;
199 }
197 200
198 if (rt->rt_flags & (RTCF_MULTICAST | RTCF_BROADCAST)) { 201 if (rt->rt_flags & (RTCF_MULTICAST | RTCF_BROADCAST)) {
199 ip_rt_put(rt); 202 ip_rt_put(rt);
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 4c7e95fa090d..5da703e699da 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -722,8 +722,11 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
722 .dport = dport } } }; 722 .dport = dport } } };
723 security_sk_classify_flow(sk, &fl); 723 security_sk_classify_flow(sk, &fl);
724 err = ip_route_output_flow(&rt, &fl, sk, 1); 724 err = ip_route_output_flow(&rt, &fl, sk, 1);
725 if (err) 725 if (err) {
726 if (err == -ENETUNREACH)
727 IP_INC_STATS_BH(IPSTATS_MIB_OUTNOROUTES);
726 goto out; 728 goto out;
729 }
727 730
728 err = -EACCES; 731 err = -EACCES;
729 if ((rt->rt_flags & RTCF_BROADCAST) && 732 if ((rt->rt_flags & RTCF_BROADCAST) &&
diff --git a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
index 6d2a08205111..dc442fb791b0 100644
--- a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
+++ b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
@@ -177,8 +177,7 @@ static unsigned int ipv6_confirm(unsigned int hooknum,
177 177
178 protoff = nf_ct_ipv6_skip_exthdr(*pskb, extoff, &pnum, 178 protoff = nf_ct_ipv6_skip_exthdr(*pskb, extoff, &pnum,
179 (*pskb)->len - extoff); 179 (*pskb)->len - extoff);
180 if (protoff < 0 || protoff > (*pskb)->len || 180 if (protoff > (*pskb)->len || pnum == NEXTHDR_FRAGMENT) {
181 pnum == NEXTHDR_FRAGMENT) {
182 DEBUGP("proto header not found\n"); 181 DEBUGP("proto header not found\n");
183 return NF_ACCEPT; 182 return NF_ACCEPT;
184 } 183 }
diff --git a/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c b/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
index 0be790d250f9..8814b95b2326 100644
--- a/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
+++ b/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
@@ -168,8 +168,7 @@ icmpv6_error_message(struct sk_buff *skb,
168 skb->len - inip6off 168 skb->len - inip6off
169 - sizeof(struct ipv6hdr)); 169 - sizeof(struct ipv6hdr));
170 170
171 if ((inprotoff < 0) || (inprotoff > skb->len) || 171 if ((inprotoff > skb->len) || (inprotonum == NEXTHDR_FRAGMENT)) {
172 (inprotonum == NEXTHDR_FRAGMENT)) {
173 DEBUGP("icmpv6_error: Can't get protocol header in ICMPv6 payload.\n"); 172 DEBUGP("icmpv6_error: Can't get protocol header in ICMPv6 payload.\n");
174 return -NF_ACCEPT; 173 return -NF_ACCEPT;
175 } 174 }
diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c
index 45b3cda86a21..6f8684b5617e 100644
--- a/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -164,8 +164,7 @@ static int tcf_pedit(struct sk_buff *skb, struct tc_action *a,
164 printk("offset must be on 32 bit boundaries\n"); 164 printk("offset must be on 32 bit boundaries\n");
165 goto bad; 165 goto bad;
166 } 166 }
167 if (skb->len < 0 || 167 if (offset > 0 && offset > skb->len) {
168 (offset > 0 && offset > skb->len)) {
169 printk("offset %d cant exceed pkt length %d\n", 168 printk("offset %d cant exceed pkt length %d\n",
170 offset, skb->len); 169 offset, skb->len);
171 goto bad; 170 goto bad;
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index cbefe225581e..f4d34480a093 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -224,7 +224,8 @@ void __netdev_watchdog_up(struct net_device *dev)
224 if (dev->tx_timeout) { 224 if (dev->tx_timeout) {
225 if (dev->watchdog_timeo <= 0) 225 if (dev->watchdog_timeo <= 0)
226 dev->watchdog_timeo = 5*HZ; 226 dev->watchdog_timeo = 5*HZ;
227 if (!mod_timer(&dev->watchdog_timer, jiffies + dev->watchdog_timeo)) 227 if (!mod_timer(&dev->watchdog_timer,
228 round_jiffies(jiffies + dev->watchdog_timeo)))
228 dev_hold(dev); 229 dev_hold(dev);
229 } 230 }
230} 231}
diff --git a/net/sctp/debug.c b/net/sctp/debug.c
index e8c0f7435d7f..80f70aa53386 100644
--- a/net/sctp/debug.c
+++ b/net/sctp/debug.c
@@ -77,8 +77,6 @@ static const char *sctp_cid_tbl[SCTP_NUM_BASE_CHUNK_TYPES] = {
77/* Lookup "chunk type" debug name. */ 77/* Lookup "chunk type" debug name. */
78const char *sctp_cname(const sctp_subtype_t cid) 78const char *sctp_cname(const sctp_subtype_t cid)
79{ 79{
80 if (cid.chunk < 0)
81 return "illegal chunk id";
82 if (cid.chunk <= SCTP_CID_BASE_MAX) 80 if (cid.chunk <= SCTP_CID_BASE_MAX)
83 return sctp_cid_tbl[cid.chunk]; 81 return sctp_cid_tbl[cid.chunk];
84 82
@@ -146,8 +144,6 @@ static const char *sctp_primitive_tbl[SCTP_NUM_PRIMITIVE_TYPES] = {
146/* Lookup primitive debug name. */ 144/* Lookup primitive debug name. */
147const char *sctp_pname(const sctp_subtype_t id) 145const char *sctp_pname(const sctp_subtype_t id)
148{ 146{
149 if (id.primitive < 0)
150 return "illegal primitive";
151 if (id.primitive <= SCTP_EVENT_PRIMITIVE_MAX) 147 if (id.primitive <= SCTP_EVENT_PRIMITIVE_MAX)
152 return sctp_primitive_tbl[id.primitive]; 148 return sctp_primitive_tbl[id.primitive];
153 return "unknown_primitive"; 149 return "unknown_primitive";
@@ -161,8 +157,6 @@ static const char *sctp_other_tbl[] = {
161/* Lookup "other" debug name. */ 157/* Lookup "other" debug name. */
162const char *sctp_oname(const sctp_subtype_t id) 158const char *sctp_oname(const sctp_subtype_t id)
163{ 159{
164 if (id.other < 0)
165 return "illegal 'other' event";
166 if (id.other <= SCTP_EVENT_OTHER_MAX) 160 if (id.other <= SCTP_EVENT_OTHER_MAX)
167 return sctp_other_tbl[id.other]; 161 return sctp_other_tbl[id.other];
168 return "unknown 'other' event"; 162 return "unknown 'other' event";
@@ -184,8 +178,6 @@ static const char *sctp_timer_tbl[] = {
184/* Lookup timer debug name. */ 178/* Lookup timer debug name. */
185const char *sctp_tname(const sctp_subtype_t id) 179const char *sctp_tname(const sctp_subtype_t id)
186{ 180{
187 if (id.timeout < 0)
188 return "illegal 'timer' event";
189 if (id.timeout <= SCTP_EVENT_TIMEOUT_MAX) 181 if (id.timeout <= SCTP_EVENT_TIMEOUT_MAX)
190 return sctp_timer_tbl[id.timeout]; 182 return sctp_timer_tbl[id.timeout];
191 return "unknown_timer"; 183 return "unknown_timer";
diff --git a/net/sctp/sm_statetable.c b/net/sctp/sm_statetable.c
index 523071c7902f..70a91ece3c49 100644
--- a/net/sctp/sm_statetable.c
+++ b/net/sctp/sm_statetable.c
@@ -960,7 +960,7 @@ static const sctp_sm_table_entry_t *sctp_chunk_event_lookup(sctp_cid_t cid,
960 if (state > SCTP_STATE_MAX) 960 if (state > SCTP_STATE_MAX)
961 return &bug; 961 return &bug;
962 962
963 if (cid >= 0 && cid <= SCTP_CID_BASE_MAX) 963 if (cid <= SCTP_CID_BASE_MAX)
964 return &chunk_event_table[cid][state]; 964 return &chunk_event_table[cid][state];
965 965
966 if (sctp_prsctp_enable) { 966 if (sctp_prsctp_enable) {
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index fc12ba51c1fc..87c794d8fa2d 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -174,11 +174,11 @@ static struct sock *unix_peer_get(struct sock *s)
174{ 174{
175 struct sock *peer; 175 struct sock *peer;
176 176
177 unix_state_rlock(s); 177 unix_state_lock(s);
178 peer = unix_peer(s); 178 peer = unix_peer(s);
179 if (peer) 179 if (peer)
180 sock_hold(peer); 180 sock_hold(peer);
181 unix_state_runlock(s); 181 unix_state_unlock(s);
182 return peer; 182 return peer;
183} 183}
184 184
@@ -369,7 +369,7 @@ static int unix_release_sock (struct sock *sk, int embrion)
369 unix_remove_socket(sk); 369 unix_remove_socket(sk);
370 370
371 /* Clear state */ 371 /* Clear state */
372 unix_state_wlock(sk); 372 unix_state_lock(sk);
373 sock_orphan(sk); 373 sock_orphan(sk);
374 sk->sk_shutdown = SHUTDOWN_MASK; 374 sk->sk_shutdown = SHUTDOWN_MASK;
375 dentry = u->dentry; 375 dentry = u->dentry;
@@ -378,7 +378,7 @@ static int unix_release_sock (struct sock *sk, int embrion)
378 u->mnt = NULL; 378 u->mnt = NULL;
379 state = sk->sk_state; 379 state = sk->sk_state;
380 sk->sk_state = TCP_CLOSE; 380 sk->sk_state = TCP_CLOSE;
381 unix_state_wunlock(sk); 381 unix_state_unlock(sk);
382 382
383 wake_up_interruptible_all(&u->peer_wait); 383 wake_up_interruptible_all(&u->peer_wait);
384 384
@@ -386,12 +386,12 @@ static int unix_release_sock (struct sock *sk, int embrion)
386 386
387 if (skpair!=NULL) { 387 if (skpair!=NULL) {
388 if (sk->sk_type == SOCK_STREAM || sk->sk_type == SOCK_SEQPACKET) { 388 if (sk->sk_type == SOCK_STREAM || sk->sk_type == SOCK_SEQPACKET) {
389 unix_state_wlock(skpair); 389 unix_state_lock(skpair);
390 /* No more writes */ 390 /* No more writes */
391 skpair->sk_shutdown = SHUTDOWN_MASK; 391 skpair->sk_shutdown = SHUTDOWN_MASK;
392 if (!skb_queue_empty(&sk->sk_receive_queue) || embrion) 392 if (!skb_queue_empty(&sk->sk_receive_queue) || embrion)
393 skpair->sk_err = ECONNRESET; 393 skpair->sk_err = ECONNRESET;
394 unix_state_wunlock(skpair); 394 unix_state_unlock(skpair);
395 skpair->sk_state_change(skpair); 395 skpair->sk_state_change(skpair);
396 read_lock(&skpair->sk_callback_lock); 396 read_lock(&skpair->sk_callback_lock);
397 sk_wake_async(skpair,1,POLL_HUP); 397 sk_wake_async(skpair,1,POLL_HUP);
@@ -448,7 +448,7 @@ static int unix_listen(struct socket *sock, int backlog)
448 err = -EINVAL; 448 err = -EINVAL;
449 if (!u->addr) 449 if (!u->addr)
450 goto out; /* No listens on an unbound socket */ 450 goto out; /* No listens on an unbound socket */
451 unix_state_wlock(sk); 451 unix_state_lock(sk);
452 if (sk->sk_state != TCP_CLOSE && sk->sk_state != TCP_LISTEN) 452 if (sk->sk_state != TCP_CLOSE && sk->sk_state != TCP_LISTEN)
453 goto out_unlock; 453 goto out_unlock;
454 if (backlog > sk->sk_max_ack_backlog) 454 if (backlog > sk->sk_max_ack_backlog)
@@ -462,7 +462,7 @@ static int unix_listen(struct socket *sock, int backlog)
462 err = 0; 462 err = 0;
463 463
464out_unlock: 464out_unlock:
465 unix_state_wunlock(sk); 465 unix_state_unlock(sk);
466out: 466out:
467 return err; 467 return err;
468} 468}
@@ -858,6 +858,31 @@ out_mknod_parent:
858 goto out_up; 858 goto out_up;
859} 859}
860 860
861static void unix_state_double_lock(struct sock *sk1, struct sock *sk2)
862{
863 if (unlikely(sk1 == sk2) || !sk2) {
864 unix_state_lock(sk1);
865 return;
866 }
867 if (sk1 < sk2) {
868 unix_state_lock(sk1);
869 unix_state_lock_nested(sk2);
870 } else {
871 unix_state_lock(sk2);
872 unix_state_lock_nested(sk1);
873 }
874}
875
876static void unix_state_double_unlock(struct sock *sk1, struct sock *sk2)
877{
878 if (unlikely(sk1 == sk2) || !sk2) {
879 unix_state_unlock(sk1);
880 return;
881 }
882 unix_state_unlock(sk1);
883 unix_state_unlock(sk2);
884}
885
861static int unix_dgram_connect(struct socket *sock, struct sockaddr *addr, 886static int unix_dgram_connect(struct socket *sock, struct sockaddr *addr,
862 int alen, int flags) 887 int alen, int flags)
863{ 888{
@@ -877,11 +902,19 @@ static int unix_dgram_connect(struct socket *sock, struct sockaddr *addr,
877 !unix_sk(sk)->addr && (err = unix_autobind(sock)) != 0) 902 !unix_sk(sk)->addr && (err = unix_autobind(sock)) != 0)
878 goto out; 903 goto out;
879 904
905restart:
880 other=unix_find_other(sunaddr, alen, sock->type, hash, &err); 906 other=unix_find_other(sunaddr, alen, sock->type, hash, &err);
881 if (!other) 907 if (!other)
882 goto out; 908 goto out;
883 909
884 unix_state_wlock(sk); 910 unix_state_double_lock(sk, other);
911
912 /* Apparently VFS overslept socket death. Retry. */
913 if (sock_flag(other, SOCK_DEAD)) {
914 unix_state_double_unlock(sk, other);
915 sock_put(other);
916 goto restart;
917 }
885 918
886 err = -EPERM; 919 err = -EPERM;
887 if (!unix_may_send(sk, other)) 920 if (!unix_may_send(sk, other))
@@ -896,7 +929,7 @@ static int unix_dgram_connect(struct socket *sock, struct sockaddr *addr,
896 * 1003.1g breaking connected state with AF_UNSPEC 929 * 1003.1g breaking connected state with AF_UNSPEC
897 */ 930 */
898 other = NULL; 931 other = NULL;
899 unix_state_wlock(sk); 932 unix_state_double_lock(sk, other);
900 } 933 }
901 934
902 /* 935 /*
@@ -905,19 +938,19 @@ static int unix_dgram_connect(struct socket *sock, struct sockaddr *addr,
905 if (unix_peer(sk)) { 938 if (unix_peer(sk)) {
906 struct sock *old_peer = unix_peer(sk); 939 struct sock *old_peer = unix_peer(sk);
907 unix_peer(sk)=other; 940 unix_peer(sk)=other;
908 unix_state_wunlock(sk); 941 unix_state_double_unlock(sk, other);
909 942
910 if (other != old_peer) 943 if (other != old_peer)
911 unix_dgram_disconnected(sk, old_peer); 944 unix_dgram_disconnected(sk, old_peer);
912 sock_put(old_peer); 945 sock_put(old_peer);
913 } else { 946 } else {
914 unix_peer(sk)=other; 947 unix_peer(sk)=other;
915 unix_state_wunlock(sk); 948 unix_state_double_unlock(sk, other);
916 } 949 }
917 return 0; 950 return 0;
918 951
919out_unlock: 952out_unlock:
920 unix_state_wunlock(sk); 953 unix_state_double_unlock(sk, other);
921 sock_put(other); 954 sock_put(other);
922out: 955out:
923 return err; 956 return err;
@@ -936,7 +969,7 @@ static long unix_wait_for_peer(struct sock *other, long timeo)
936 (skb_queue_len(&other->sk_receive_queue) > 969 (skb_queue_len(&other->sk_receive_queue) >
937 other->sk_max_ack_backlog); 970 other->sk_max_ack_backlog);
938 971
939 unix_state_runlock(other); 972 unix_state_unlock(other);
940 973
941 if (sched) 974 if (sched)
942 timeo = schedule_timeout(timeo); 975 timeo = schedule_timeout(timeo);
@@ -994,11 +1027,11 @@ restart:
994 goto out; 1027 goto out;
995 1028
996 /* Latch state of peer */ 1029 /* Latch state of peer */
997 unix_state_rlock(other); 1030 unix_state_lock(other);
998 1031
999 /* Apparently VFS overslept socket death. Retry. */ 1032 /* Apparently VFS overslept socket death. Retry. */
1000 if (sock_flag(other, SOCK_DEAD)) { 1033 if (sock_flag(other, SOCK_DEAD)) {
1001 unix_state_runlock(other); 1034 unix_state_unlock(other);
1002 sock_put(other); 1035 sock_put(other);
1003 goto restart; 1036 goto restart;
1004 } 1037 }
@@ -1048,18 +1081,18 @@ restart:
1048 goto out_unlock; 1081 goto out_unlock;
1049 } 1082 }
1050 1083
1051 unix_state_wlock_nested(sk); 1084 unix_state_lock_nested(sk);
1052 1085
1053 if (sk->sk_state != st) { 1086 if (sk->sk_state != st) {
1054 unix_state_wunlock(sk); 1087 unix_state_unlock(sk);
1055 unix_state_runlock(other); 1088 unix_state_unlock(other);
1056 sock_put(other); 1089 sock_put(other);
1057 goto restart; 1090 goto restart;
1058 } 1091 }
1059 1092
1060 err = security_unix_stream_connect(sock, other->sk_socket, newsk); 1093 err = security_unix_stream_connect(sock, other->sk_socket, newsk);
1061 if (err) { 1094 if (err) {
1062 unix_state_wunlock(sk); 1095 unix_state_unlock(sk);
1063 goto out_unlock; 1096 goto out_unlock;
1064 } 1097 }
1065 1098
@@ -1096,7 +1129,7 @@ restart:
1096 smp_mb__after_atomic_inc(); /* sock_hold() does an atomic_inc() */ 1129 smp_mb__after_atomic_inc(); /* sock_hold() does an atomic_inc() */
1097 unix_peer(sk) = newsk; 1130 unix_peer(sk) = newsk;
1098 1131
1099 unix_state_wunlock(sk); 1132 unix_state_unlock(sk);
1100 1133
1101 /* take ten and and send info to listening sock */ 1134 /* take ten and and send info to listening sock */
1102 spin_lock(&other->sk_receive_queue.lock); 1135 spin_lock(&other->sk_receive_queue.lock);
@@ -1105,14 +1138,14 @@ restart:
1105 * is installed to listening socket. */ 1138 * is installed to listening socket. */
1106 atomic_inc(&newu->inflight); 1139 atomic_inc(&newu->inflight);
1107 spin_unlock(&other->sk_receive_queue.lock); 1140 spin_unlock(&other->sk_receive_queue.lock);
1108 unix_state_runlock(other); 1141 unix_state_unlock(other);
1109 other->sk_data_ready(other, 0); 1142 other->sk_data_ready(other, 0);
1110 sock_put(other); 1143 sock_put(other);
1111 return 0; 1144 return 0;
1112 1145
1113out_unlock: 1146out_unlock:
1114 if (other) 1147 if (other)
1115 unix_state_runlock(other); 1148 unix_state_unlock(other);
1116 1149
1117out: 1150out:
1118 if (skb) 1151 if (skb)
@@ -1178,10 +1211,10 @@ static int unix_accept(struct socket *sock, struct socket *newsock, int flags)
1178 wake_up_interruptible(&unix_sk(sk)->peer_wait); 1211 wake_up_interruptible(&unix_sk(sk)->peer_wait);
1179 1212
1180 /* attach accepted sock to socket */ 1213 /* attach accepted sock to socket */
1181 unix_state_wlock(tsk); 1214 unix_state_lock(tsk);
1182 newsock->state = SS_CONNECTED; 1215 newsock->state = SS_CONNECTED;
1183 sock_graft(tsk, newsock); 1216 sock_graft(tsk, newsock);
1184 unix_state_wunlock(tsk); 1217 unix_state_unlock(tsk);
1185 return 0; 1218 return 0;
1186 1219
1187out: 1220out:
@@ -1208,7 +1241,7 @@ static int unix_getname(struct socket *sock, struct sockaddr *uaddr, int *uaddr_
1208 } 1241 }
1209 1242
1210 u = unix_sk(sk); 1243 u = unix_sk(sk);
1211 unix_state_rlock(sk); 1244 unix_state_lock(sk);
1212 if (!u->addr) { 1245 if (!u->addr) {
1213 sunaddr->sun_family = AF_UNIX; 1246 sunaddr->sun_family = AF_UNIX;
1214 sunaddr->sun_path[0] = 0; 1247 sunaddr->sun_path[0] = 0;
@@ -1219,7 +1252,7 @@ static int unix_getname(struct socket *sock, struct sockaddr *uaddr, int *uaddr_
1219 *uaddr_len = addr->len; 1252 *uaddr_len = addr->len;
1220 memcpy(sunaddr, addr->name, *uaddr_len); 1253 memcpy(sunaddr, addr->name, *uaddr_len);
1221 } 1254 }
1222 unix_state_runlock(sk); 1255 unix_state_unlock(sk);
1223 sock_put(sk); 1256 sock_put(sk);
1224out: 1257out:
1225 return err; 1258 return err;
@@ -1337,7 +1370,7 @@ restart:
1337 goto out_free; 1370 goto out_free;
1338 } 1371 }
1339 1372
1340 unix_state_rlock(other); 1373 unix_state_lock(other);
1341 err = -EPERM; 1374 err = -EPERM;
1342 if (!unix_may_send(sk, other)) 1375 if (!unix_may_send(sk, other))
1343 goto out_unlock; 1376 goto out_unlock;
@@ -1347,20 +1380,20 @@ restart:
1347 * Check with 1003.1g - what should 1380 * Check with 1003.1g - what should
1348 * datagram error 1381 * datagram error
1349 */ 1382 */
1350 unix_state_runlock(other); 1383 unix_state_unlock(other);
1351 sock_put(other); 1384 sock_put(other);
1352 1385
1353 err = 0; 1386 err = 0;
1354 unix_state_wlock(sk); 1387 unix_state_lock(sk);
1355 if (unix_peer(sk) == other) { 1388 if (unix_peer(sk) == other) {
1356 unix_peer(sk)=NULL; 1389 unix_peer(sk)=NULL;
1357 unix_state_wunlock(sk); 1390 unix_state_unlock(sk);
1358 1391
1359 unix_dgram_disconnected(sk, other); 1392 unix_dgram_disconnected(sk, other);
1360 sock_put(other); 1393 sock_put(other);
1361 err = -ECONNREFUSED; 1394 err = -ECONNREFUSED;
1362 } else { 1395 } else {
1363 unix_state_wunlock(sk); 1396 unix_state_unlock(sk);
1364 } 1397 }
1365 1398
1366 other = NULL; 1399 other = NULL;
@@ -1397,14 +1430,14 @@ restart:
1397 } 1430 }
1398 1431
1399 skb_queue_tail(&other->sk_receive_queue, skb); 1432 skb_queue_tail(&other->sk_receive_queue, skb);
1400 unix_state_runlock(other); 1433 unix_state_unlock(other);
1401 other->sk_data_ready(other, len); 1434 other->sk_data_ready(other, len);
1402 sock_put(other); 1435 sock_put(other);
1403 scm_destroy(siocb->scm); 1436 scm_destroy(siocb->scm);
1404 return len; 1437 return len;
1405 1438
1406out_unlock: 1439out_unlock:
1407 unix_state_runlock(other); 1440 unix_state_unlock(other);
1408out_free: 1441out_free:
1409 kfree_skb(skb); 1442 kfree_skb(skb);
1410out: 1443out:
@@ -1494,14 +1527,14 @@ static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock,
1494 goto out_err; 1527 goto out_err;
1495 } 1528 }
1496 1529
1497 unix_state_rlock(other); 1530 unix_state_lock(other);
1498 1531
1499 if (sock_flag(other, SOCK_DEAD) || 1532 if (sock_flag(other, SOCK_DEAD) ||
1500 (other->sk_shutdown & RCV_SHUTDOWN)) 1533 (other->sk_shutdown & RCV_SHUTDOWN))
1501 goto pipe_err_free; 1534 goto pipe_err_free;
1502 1535
1503 skb_queue_tail(&other->sk_receive_queue, skb); 1536 skb_queue_tail(&other->sk_receive_queue, skb);
1504 unix_state_runlock(other); 1537 unix_state_unlock(other);
1505 other->sk_data_ready(other, size); 1538 other->sk_data_ready(other, size);
1506 sent+=size; 1539 sent+=size;
1507 } 1540 }
@@ -1512,7 +1545,7 @@ static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock,
1512 return sent; 1545 return sent;
1513 1546
1514pipe_err_free: 1547pipe_err_free:
1515 unix_state_runlock(other); 1548 unix_state_unlock(other);
1516 kfree_skb(skb); 1549 kfree_skb(skb);
1517pipe_err: 1550pipe_err:
1518 if (sent==0 && !(msg->msg_flags&MSG_NOSIGNAL)) 1551 if (sent==0 && !(msg->msg_flags&MSG_NOSIGNAL))
@@ -1641,7 +1674,7 @@ static long unix_stream_data_wait(struct sock * sk, long timeo)
1641{ 1674{
1642 DEFINE_WAIT(wait); 1675 DEFINE_WAIT(wait);
1643 1676
1644 unix_state_rlock(sk); 1677 unix_state_lock(sk);
1645 1678
1646 for (;;) { 1679 for (;;) {
1647 prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); 1680 prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
@@ -1654,14 +1687,14 @@ static long unix_stream_data_wait(struct sock * sk, long timeo)
1654 break; 1687 break;
1655 1688
1656 set_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags); 1689 set_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags);
1657 unix_state_runlock(sk); 1690 unix_state_unlock(sk);
1658 timeo = schedule_timeout(timeo); 1691 timeo = schedule_timeout(timeo);
1659 unix_state_rlock(sk); 1692 unix_state_lock(sk);
1660 clear_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags); 1693 clear_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags);
1661 } 1694 }
1662 1695
1663 finish_wait(sk->sk_sleep, &wait); 1696 finish_wait(sk->sk_sleep, &wait);
1664 unix_state_runlock(sk); 1697 unix_state_unlock(sk);
1665 return timeo; 1698 return timeo;
1666} 1699}
1667 1700
@@ -1816,12 +1849,12 @@ static int unix_shutdown(struct socket *sock, int mode)
1816 mode = (mode+1)&(RCV_SHUTDOWN|SEND_SHUTDOWN); 1849 mode = (mode+1)&(RCV_SHUTDOWN|SEND_SHUTDOWN);
1817 1850
1818 if (mode) { 1851 if (mode) {
1819 unix_state_wlock(sk); 1852 unix_state_lock(sk);
1820 sk->sk_shutdown |= mode; 1853 sk->sk_shutdown |= mode;
1821 other=unix_peer(sk); 1854 other=unix_peer(sk);
1822 if (other) 1855 if (other)
1823 sock_hold(other); 1856 sock_hold(other);
1824 unix_state_wunlock(sk); 1857 unix_state_unlock(sk);
1825 sk->sk_state_change(sk); 1858 sk->sk_state_change(sk);
1826 1859
1827 if (other && 1860 if (other &&
@@ -1833,9 +1866,9 @@ static int unix_shutdown(struct socket *sock, int mode)
1833 peer_mode |= SEND_SHUTDOWN; 1866 peer_mode |= SEND_SHUTDOWN;
1834 if (mode&SEND_SHUTDOWN) 1867 if (mode&SEND_SHUTDOWN)
1835 peer_mode |= RCV_SHUTDOWN; 1868 peer_mode |= RCV_SHUTDOWN;
1836 unix_state_wlock(other); 1869 unix_state_lock(other);
1837 other->sk_shutdown |= peer_mode; 1870 other->sk_shutdown |= peer_mode;
1838 unix_state_wunlock(other); 1871 unix_state_unlock(other);
1839 other->sk_state_change(other); 1872 other->sk_state_change(other);
1840 read_lock(&other->sk_callback_lock); 1873 read_lock(&other->sk_callback_lock);
1841 if (peer_mode == SHUTDOWN_MASK) 1874 if (peer_mode == SHUTDOWN_MASK)
@@ -1973,7 +2006,7 @@ static int unix_seq_show(struct seq_file *seq, void *v)
1973 else { 2006 else {
1974 struct sock *s = v; 2007 struct sock *s = v;
1975 struct unix_sock *u = unix_sk(s); 2008 struct unix_sock *u = unix_sk(s);
1976 unix_state_rlock(s); 2009 unix_state_lock(s);
1977 2010
1978 seq_printf(seq, "%p: %08X %08X %08X %04X %02X %5lu", 2011 seq_printf(seq, "%p: %08X %08X %08X %04X %02X %5lu",
1979 s, 2012 s,
@@ -2001,7 +2034,7 @@ static int unix_seq_show(struct seq_file *seq, void *v)
2001 for ( ; i < len; i++) 2034 for ( ; i < len; i++)
2002 seq_putc(seq, u->addr->name->sun_path[i]); 2035 seq_putc(seq, u->addr->name->sun_path[i]);
2003 } 2036 }
2004 unix_state_runlock(s); 2037 unix_state_unlock(s);
2005 seq_putc(seq, '\n'); 2038 seq_putc(seq, '\n');
2006 } 2039 }
2007 2040
diff --git a/net/wanrouter/wanmain.c b/net/wanrouter/wanmain.c
index 7a19e0ede289..849cc06bd914 100644
--- a/net/wanrouter/wanmain.c
+++ b/net/wanrouter/wanmain.c
@@ -454,7 +454,7 @@ static int wanrouter_device_setup(struct wan_device *wandev,
454 } 454 }
455 455
456 if (conf->data_size && conf->data) { 456 if (conf->data_size && conf->data) {
457 if (conf->data_size > 128000 || conf->data_size < 0) { 457 if (conf->data_size > 128000) {
458 printk(KERN_INFO 458 printk(KERN_INFO
459 "%s: ERROR, Invalid firmware data size %i !\n", 459 "%s: ERROR, Invalid firmware data size %i !\n",
460 wandev->name, conf->data_size); 460 wandev->name, conf->data_size);