summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_rctl.c
diff options
context:
space:
mode:
authorgjb <gjb@FreeBSD.org>2016-04-13 02:04:09 +0000
committergjb <gjb@FreeBSD.org>2016-04-13 02:04:09 +0000
commitcad5e8d3bce52708ae6b253a4427d56b4befd46c (patch)
tree92bbcf5b84bdd150282eaf6ec82e328e0e517eca /sys/kern/kern_rctl.c
parent2d6ac6ea572ca93a1ff4e32936214246cc9b2551 (diff)
parent5c3b3f706fae5bed563c4681b89e06b1a2860417 (diff)
downloadFreeBSD-src-cad5e8d3bce52708ae6b253a4427d56b4befd46c.zip
FreeBSD-src-cad5e8d3bce52708ae6b253a4427d56b4befd46c.tar.gz
MFH
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys/kern/kern_rctl.c')
-rw-r--r--sys/kern/kern_rctl.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/sys/kern/kern_rctl.c b/sys/kern/kern_rctl.c
index 2442852..98b5055 100644
--- a/sys/kern/kern_rctl.c
+++ b/sys/kern/kern_rctl.c
@@ -495,17 +495,11 @@ xadd(uint64_t a, uint64_t b)
static uint64_t
xmul(uint64_t a, uint64_t b)
{
- uint64_t c;
-
- if (a == 0 || b == 0)
- return (0);
- c = a * b;
-
- if (c < a || c < b)
+ if (b != 0 && a > UINT64_MAX / b)
return (UINT64_MAX);
- return (c);
+ return (a * b);
}
/*
OpenPOWER on IntegriCloud