Commit bfbea8a8 authored by Wong Hoi Sing Edison's avatar Wong Hoi Sing Edison Committed by David S. Miller

[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: default avatarWong Hoi Sing Edison <hswong3i@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 18114746
...@@ -31,8 +31,6 @@ ...@@ -31,8 +31,6 @@
* Hung Hing Lun, Mike <hlhung3i@gmail.com> * Hung Hing Lun, Mike <hlhung3i@gmail.com>
* SourceForge project page: * SourceForge project page:
* http://tcp-lp-mod.sourceforge.net/ * http://tcp-lp-mod.sourceforge.net/
*
* Version: $Id: tcp_lp.c,v 1.24 2006/09/05 20:22:53 hswong3i Exp $
*/ */
#include <linux/module.h> #include <linux/module.h>
...@@ -164,7 +162,7 @@ static u32 tcp_lp_remote_hz_estimator(struct sock *sk) ...@@ -164,7 +162,7 @@ static u32 tcp_lp_remote_hz_estimator(struct sock *sk)
out: out:
/* record time for successful remote HZ calc */ /* record time for successful remote HZ calc */
if (rhz > 0) if ((rhz >> 6) > 0)
lp->flag |= LP_VALID_RHZ; lp->flag |= LP_VALID_RHZ;
else else
lp->flag &= ~LP_VALID_RHZ; lp->flag &= ~LP_VALID_RHZ;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment