summaryrefslogtreecommitdiffstats
path: root/sys/dev/hyperv
diff options
context:
space:
mode:
authorsmh <smh@FreeBSD.org>2014-12-21 03:06:11 +0000
committersmh <smh@FreeBSD.org>2014-12-21 03:06:11 +0000
commitf73f068967977545d4d60b36864475974dca2613 (patch)
tree25e0e0aad4faf12d9100173a8b5cb4866ec97cdf /sys/dev/hyperv
parent4ae371d305e8c60f2e534058d1727f819749b623 (diff)
downloadFreeBSD-src-f73f068967977545d4d60b36864475974dca2613.zip
FreeBSD-src-f73f068967977545d4d60b36864475974dca2613.tar.gz
MFC r274819:
Prevent overflow issues in timeout processing MFC r274852: Fix build with asr driver Sponsored by: Multiplay
Diffstat (limited to 'sys/dev/hyperv')
-rw-r--r--sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c b/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
index de5b43e..d00d279 100644
--- a/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
+++ b/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
@@ -983,9 +983,8 @@ storvsc_timeout(void *arg)
mtx_unlock(&sc->hs_lock);
reqp->retries++;
- callout_reset(&reqp->callout,
- (ccb->ccb_h.timeout * hz) / 1000,
- storvsc_timeout, reqp);
+ callout_reset_sbt(&reqp->callout, SBT_1MS * ccb->ccb_h.timeout,
+ 0, storvsc_timeout, reqp, 0);
#if HVS_TIMEOUT_TEST
storvsc_timeout_test(reqp, SEND_DIAGNOSTIC, 0);
#endif
@@ -1158,9 +1157,9 @@ storvsc_action(struct cam_sim *sim, union ccb *ccb)
if (ccb->ccb_h.timeout != CAM_TIME_INFINITY) {
callout_init(&reqp->callout, CALLOUT_MPSAFE);
- callout_reset(&reqp->callout,
- (ccb->ccb_h.timeout * hz) / 1000,
- storvsc_timeout, reqp);
+ callout_reset_sbt(&reqp->callout,
+ SBT_1MS * ccb->ccb_h.timeout, 0,
+ storvsc_timeout, reqp, 0);
#if HVS_TIMEOUT_TEST
cv_init(&reqp->event.cv, "storvsc timeout cv");
mtx_init(&reqp->event.mtx, "storvsc timeout mutex",
OpenPOWER on IntegriCloud