From b3db2736b15954ccd1899b0abb58cc4f6ff7fdaf Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Thu, 8 Sep 2016 19:47:57 +0000 Subject: [PATCH] Don't check aq64_minfree which is unsigned for negative values. This fixes a tautological comparison warning. Reviewed by: rwatson Differential Revision: https://reviews.freebsd.org/D7682 --- sys/security/audit/audit_syscalls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/security/audit/audit_syscalls.c b/sys/security/audit/audit_syscalls.c index 73411a474c6..b134b0a355f 100644 --- a/sys/security/audit/audit_syscalls.c +++ b/sys/security/audit/audit_syscalls.c @@ -299,12 +299,12 @@ sys_auditon(struct thread *td, struct auditon_args *uap) case A_OLDSETQCTRL: case A_SETQCTRL: if (uap->length == sizeof(udata.au_qctrl64)) { + /* NB: aq64_minfree is unsigned unlike aq_minfree. */ if ((udata.au_qctrl64.aq64_hiwater > AQ_MAXHIGH) || (udata.au_qctrl64.aq64_lowater >= udata.au_qctrl.aq_hiwater) || (udata.au_qctrl64.aq64_bufsz > AQ_MAXBUFSZ) || - (udata.au_qctrl64.aq64_minfree > 100) || - (udata.au_qctrl64.aq64_minfree < 0)) + (udata.au_qctrl64.aq64_minfree > 100)) return (EINVAL); audit_qctrl.aq_hiwater = (int)udata.au_qctrl64.aq64_hiwater;