diff options
author | Wong Hoi Sing Edison <hswong3i@gmail.com> | 2006-09-28 17:40:21 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-09-28 21:03:07 -0400 |
commit | bfbea8a8869a0e21b97605841d04190d63665d19 (patch) | |
tree | c447c1787942fcc9d2b4c6b7404ca75104984c70 /net/ipv4/tcp_lp.c | |
parent | 1811474620d1986da45f7245168bf7c2d883d770 (diff) |
[TCP] tcp-lp: prevent chance for oops
This patch fix the chance for tcp_lp_remote_hz_estimator return 0, if
0 < rhz < 64. It also make sure the flag LP_VALID_RHZ is set
correctly.
Signed-off-by: Wong Hoi Sing Edison <hswong3i@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_lp.c')
-rw-r--r-- | net/ipv4/tcp_lp.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/net/ipv4/tcp_lp.c b/net/ipv4/tcp_lp.c index 308fb7e071c5..f0ebaf0e21cb 100644 --- a/net/ipv4/tcp_lp.c +++ b/net/ipv4/tcp_lp.c | |||
@@ -31,8 +31,6 @@ | |||
31 | * Hung Hing Lun, Mike <hlhung3i@gmail.com> | 31 | * Hung Hing Lun, Mike <hlhung3i@gmail.com> |
32 | * SourceForge project page: | 32 | * SourceForge project page: |
33 | * http://tcp-lp-mod.sourceforge.net/ | 33 | * http://tcp-lp-mod.sourceforge.net/ |
34 | * | ||
35 | * Version: $Id: tcp_lp.c,v 1.24 2006/09/05 20:22:53 hswong3i Exp $ | ||
36 | */ | 34 | */ |
37 | 35 | ||
38 | #include <linux/module.h> | 36 | #include <linux/module.h> |
@@ -164,7 +162,7 @@ static u32 tcp_lp_remote_hz_estimator(struct sock *sk) | |||
164 | 162 | ||
165 | out: | 163 | out: |
166 | /* record time for successful remote HZ calc */ | 164 | /* record time for successful remote HZ calc */ |
167 | if (rhz > 0) | 165 | if ((rhz >> 6) > 0) |
168 | lp->flag |= LP_VALID_RHZ; | 166 | lp->flag |= LP_VALID_RHZ; |
169 | else | 167 | else |
170 | lp->flag &= ~LP_VALID_RHZ; | 168 | lp->flag &= ~LP_VALID_RHZ; |