summaryrefslogtreecommitdiffstats
path: root/kernel/fs/ncpfs/ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/fs/ncpfs/ioctl.c')
-rw-r--r--kernel/fs/ncpfs/ioctl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/fs/ncpfs/ioctl.c b/kernel/fs/ncpfs/ioctl.c
index 79b113048..0a3f9b594 100644
--- a/kernel/fs/ncpfs/ioctl.c
+++ b/kernel/fs/ncpfs/ioctl.c
@@ -525,6 +525,8 @@ static long __ncp_ioctl(struct inode *inode, unsigned int cmd, unsigned long arg
switch (rqdata.cmd) {
case NCP_LOCK_EX:
case NCP_LOCK_SH:
+ if (rqdata.timeout < 0)
+ return -EINVAL;
if (rqdata.timeout == 0)
rqdata.timeout = NCP_LOCK_DEFAULT_TIMEOUT;
else if (rqdata.timeout > NCP_LOCK_MAX_TIMEOUT)