git: 0996dd7df688 - main - cuse(3): Fix an off-by-one.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 20 Jul 2022 08:47:07 UTC
The branch main has been updated by hselasky:
URL: https://cgit.FreeBSD.org/src/commit/?id=0996dd7df688921bd41b255e4cdcc155fda8461a
commit 0996dd7df688921bd41b255e4cdcc155fda8461a
Author: Hans Petter Selasky <hselasky@FreeBSD.org>
AuthorDate: 2022-07-13 13:53:49 +0000
Commit: Hans Petter Selasky <hselasky@FreeBSD.org>
CommitDate: 2022-07-20 08:41:11 +0000
cuse(3): Fix an off-by-one.
The page allocation limit is inclusive and not exclusive.
MFC after: 1 week
Sponsored by: NVIDIA Networking
---
sys/fs/cuse/cuse.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/fs/cuse/cuse.c b/sys/fs/cuse/cuse.c
index 7c7d8ec20493..5a0d0263738e 100644
--- a/sys/fs/cuse/cuse.c
+++ b/sys/fs/cuse/cuse.c
@@ -1159,7 +1159,7 @@ cuse_server_ioctl(struct cdev *dev, unsigned long cmd,
error = ENOMEM;
break;
}
- if (pai->page_count >= CUSE_ALLOC_PAGES_MAX) {
+ if (pai->page_count > CUSE_ALLOC_PAGES_MAX) {
error = ENOMEM;
break;
}