aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorHugh Dickins <hugh@veritas.com>2004-09-13 17:46:38 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-09-13 17:46:38 -0700
commit819155f3f9dab37ce6c9a45061c474ccc5df38d8 (patch)
tree72171ef8d2544ec5ea609a0de941e49b0be97efe /mm
parentae801aa19eb82e1db62c6199c3b77a191a91580b (diff)
downloadhistory-819155f3f9dab37ce6c9a45061c474ccc5df38d8.tar.gz
[PATCH] shmem: Copyright file_setup trivia
I _think_ shmem_file_setup is protected against negative loff_t size by the TASK_SIZE in each arch, but prefer the security of an explicit test. Wipe those parentheses off its return(file), and update our Copyright. Signed-off-by: Hugh Dickins <hugh@veritas.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/shmem.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mm/shmem.c b/mm/shmem.c
index 4cf5596e92a3ed..3a8d1636298e20 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -6,8 +6,8 @@
* 2000-2001 Christoph Rohland
* 2000-2001 SAP AG
* 2002 Red Hat Inc.
- * Copyright (C) 2002-2003 Hugh Dickins.
- * Copyright (C) 2002-2003 VERITAS Software Corporation.
+ * Copyright (C) 2002-2004 Hugh Dickins.
+ * Copyright (C) 2002-2004 VERITAS Software Corporation.
* Copyright (C) 2004 Andi Kleen, SuSE Labs
*
* This file is released under the GPL.
@@ -2099,7 +2099,7 @@ struct file *shmem_file_setup(char *name, loff_t size, unsigned long flags)
if (IS_ERR(shm_mnt))
return (void *)shm_mnt;
- if (size > SHMEM_MAX_BYTES)
+ if (size < 0 || size > SHMEM_MAX_BYTES)
return ERR_PTR(-EINVAL);
if (shmem_acct_size(flags, size))
@@ -2133,7 +2133,7 @@ struct file *shmem_file_setup(char *name, loff_t size, unsigned long flags)
file->f_mapping = inode->i_mapping;
file->f_op = &shmem_file_operations;
file->f_mode = FMODE_WRITE | FMODE_READ;
- return(file);
+ return file;
close_file:
put_filp(file);