From 45f7325efedcd4e8916c2a486831bf174ed21021 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Tue, 26 Mar 2024 17:55:41 -0400 Subject: kernel: filedesc: Create MAX_RW_SIZE define Signed-off-by: Ian Moffett --- sys/kern/kern_filedesc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys') diff --git a/sys/kern/kern_filedesc.c b/sys/kern/kern_filedesc.c index 0037f55..72d294d 100644 --- a/sys/kern/kern_filedesc.c +++ b/sys/kern/kern_filedesc.c @@ -39,6 +39,8 @@ #include #include +#define MAX_RW_SIZE 0x7FFFF000 + /* * This function is a helper for write(). It creates * a buffer and copies write data to it. @@ -51,10 +53,9 @@ static int make_write_buf(struct proc *td, const void *data, char **buf_out, size_t count) { - const size_t MAX_COUNT = 0x7FFFF000; char *buf = NULL; - if (count > MAX_COUNT || count == 0) { + if (count > MAX_RW_SIZE || count == 0) { return -EINVAL; } -- cgit v1.2.3