* [PATCH] file: remove redundant assignment to variable err
@ 2020-12-04 17:56 Colin King
0 siblings, 0 replies; only message in thread
From: Colin King @ 2020-12-04 17:56 UTC (permalink / raw)
To: Alexander Viro, linux-fsdevel; +Cc: kernel-janitors, linux-kernel
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 --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;
--
2.29.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-12-04 17:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-04 17:56 [PATCH] file: remove redundant assignment to variable err Colin King
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).