diff mbox series

cifs: remove redundant initialization of variable rc

Message ID 20210613140123.74900-1-colin.king@canonical.com (mailing list archive)
State New, archived
Headers show
Series cifs: remove redundant initialization of variable rc | expand

Commit Message

Colin King June 13, 2021, 2:01 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

The variable rc is being initialized with a value that is never read, the
assignment is redundant and can be removed.

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

Comments

Steve French June 13, 2021, 11:33 p.m. UTC | #1
merged into cifs-2.6.git for-next

On Sun, Jun 13, 2021 at 9:02 AM Colin King <colin.king@canonical.com> wrote:
>
> From: Colin Ian King <colin.king@canonical.com>
>
> The variable rc is being initialized with a value that is never read, the
> assignment is redundant and can be removed.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  fs/cifs/cifssmb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
> index 037c44bf48f1..277cb1044cbe 100644
> --- a/fs/cifs/cifssmb.c
> +++ b/fs/cifs/cifssmb.c
> @@ -1238,7 +1238,7 @@ SMBLegacyOpen(const unsigned int xid, struct cifs_tcon *tcon,
>             int *pOplock, FILE_ALL_INFO *pfile_info,
>             const struct nls_table *nls_codepage, int remap)
>  {
> -       int rc = -EACCES;
> +       int rc;
>         OPENX_REQ *pSMB = NULL;
>         OPENX_RSP *pSMBr = NULL;
>         int bytes_returned;
> --
> 2.31.1
>
diff mbox series

Patch

diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 037c44bf48f1..277cb1044cbe 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -1238,7 +1238,7 @@  SMBLegacyOpen(const unsigned int xid, struct cifs_tcon *tcon,
 	    int *pOplock, FILE_ALL_INFO *pfile_info,
 	    const struct nls_table *nls_codepage, int remap)
 {
-	int rc = -EACCES;
+	int rc;
 	OPENX_REQ *pSMB = NULL;
 	OPENX_RSP *pSMBr = NULL;
 	int bytes_returned;