[PATCH 7/7] shmem: Copyright file_setup trivia

From: Hugh Dickins
Date: Sun Sep 05 2004 - 17:55:13 EST


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@xxxxxxxxxxx>
---

mm/shmem.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

--- shmem6/mm/shmem.c 2004-09-05 17:06:41.258138744 +0100
+++ shmem7/mm/shmem.c 2004-09-05 17:06:52.371449264 +0100
@@ -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
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
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);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/