2021-03-25 17:37:18

by Colin King

[permalink] [raw]
Subject: [PATCH][next] cifsd: remove redundant assignment to variable err

From: Colin Ian King <[email protected]>

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 <[email protected]>
---
fs/cifsd/vfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/cifsd/vfs.c b/fs/cifsd/vfs.c
index 00f80ca45690..3d7413b8f526 100644
--- a/fs/cifsd/vfs.c
+++ b/fs/cifsd/vfs.c
@@ -587,7 +587,7 @@ int ksmbd_vfs_remove_file(struct ksmbd_work *work, char *name)
struct path parent;
struct dentry *dir, *dentry;
char *last;
- int err = -ENOENT;
+ int err;

last = extract_last_component(name);
if (!last)
--
2.30.2


2021-03-27 05:45:13

by Namjae Jeon

[permalink] [raw]
Subject: Re: [Linux-cifsd-devel] [PATCH][next] cifsd: remove redundant assignment to variable err

2021-03-26 2:35 GMT+09:00, Colin King <[email protected]>:
> From: Colin Ian King <[email protected]>
>
> 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 <[email protected]>
I will apply. Thanks for your patch!