[PATCH 2/2] vfs: remove unneeded error assignment in do_sys_ftruncate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jie Liu <jeff.liu@xxxxxxxxxx>

Get rid of a redundant error re-assignment in do_sys_ftruncate().

Signed-off-by: Jie Liu <jeff.liu@xxxxxxxxxx>
---
 fs/open.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/open.c b/fs/open.c
index 327cfb1..815e2e2 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -154,9 +154,8 @@ static long do_sys_ftruncate(unsigned int fd, loff_t length, int small)
 	struct inode *inode;
 	struct dentry *dentry;
 	struct fd f;
-	int error;
+	int error = -EINVAL;
 
-	error = -EINVAL;
 	if (length < 0)
 		goto out;
 	error = -EBADF;
@@ -174,7 +173,6 @@ static long do_sys_ftruncate(unsigned int fd, loff_t length, int small)
 	if (!S_ISREG(inode->i_mode) || !(f.file->f_mode & FMODE_WRITE))
 		goto out_putf;
 
-	error = -EINVAL;
 	/* Cannot ftruncate over 2^31 bytes without large file support */
 	if (small && length > MAX_NON_LFS)
 		goto out_putf;
-- 
1.8.3.2
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux