diff mbox series

file: remove redundant assignment to variable err

Message ID 20201204175600.1147876-1-colin.king@canonical.com (mailing list archive)
State New
Headers show
Series file: remove redundant assignment to variable err | expand

Commit Message

Colin King Dec. 4, 2020, 5:56 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

The variable err is being initialized with a value that is never read
and it is being updated later with a new value.  The initialization is
redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
 fs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series


diff --git a/fs/file.c b/fs/file.c
index 412033d8cfdf..5d1d1b2a5c97 100644
--- a/fs/file.c
+++ b/fs/file.c
@@ -1086,7 +1086,7 @@  int __receive_fd(int fd, struct file *file, int __user *ufd, unsigned int o_flag
 static int ksys_dup3(unsigned int oldfd, unsigned int newfd, int flags)
-	int err = -EBADF;
+	int err;
 	struct file *file;
 	struct files_struct *files = current->files;