Skip to contentSkip to conversation

vfs: remove unnecessary assignment in do_sys_ftruncate()

PATCH New Chengguang Xu 1 participant 1 message Jun 27, 2020 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vfs: remove unnecessary assignment in do_sys_ftruncate()

We have already set error to -EINVAL, so don't have to do it again.

---
 fs/open.c | 1 -
 1 file changed, 1 deletion(-)
fs/open.c +0 -1
index 6cd48a61cda3..f1ec0c1ad135 100644
@@ -177,7 +177,6 @@ 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;
Signature · 1 line
2.26.2