summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2014-06-17 14:07:02 +0400
committerJohannes Berg <johannes.berg@intel.com>2014-06-23 13:29:25 +0400
commit0ce12026d6ea4a24d52ddcde36b9643f2e26d560 (patch)
treeb245ae02e5719e1811ee39749c03c6ce5770f010 /net
parente33e2241e272eddc38339692500bd1c7d8753a77 (diff)
downloadlinux-0ce12026d6ea4a24d52ddcde36b9643f2e26d560.tar.xz
cfg80211: fix elapsed_jiffies calculation
MAX_JIFFY_OFFSET has no meaning when calculating the elapsed jiffies, as jiffies run out until ULONG_MAX. This miscalculation results in erroneous values in case of a wrap-around. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/wireless/core.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/wireless/core.h b/net/wireless/core.h
index e9afbf10e756..7e3a3cef7df9 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -424,7 +424,7 @@ static inline unsigned int elapsed_jiffies_msecs(unsigned long start)
if (end >= start)
return jiffies_to_msecs(end - start);
- return jiffies_to_msecs(end + (MAX_JIFFY_OFFSET - start) + 1);
+ return jiffies_to_msecs(end + (ULONG_MAX - start) + 1);
}
void