All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] CIFS: fix structurally dead code in smb311_posix_mkdir
@ 2018-06-21 13:35 Gustavo A. R. Silva
  2018-06-21 16:59 ` Steve French
  0 siblings, 1 reply; 3+ messages in thread
From: Gustavo A. R. Silva @ 2018-06-21 13:35 UTC (permalink / raw)
  To: Aurelien Aptel, Steve French
  Cc: linux-cifs, samba-technical, linux-kernel, Gustavo A. R. Silva

Code at line: 1950: rc = -EIO; is unreachable. Hence, the function
returns rc with a value of zero and, this is not the actual intention
of this particular piece of code.

Fix this by placing the goto instruction just after the update to rc.

Addresses-Coverity-ID: 1470124 ("Structurally dead code")
Fixes: 5539e9b24a38 ("CIFS: fix memory leak and remove dead code")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 fs/cifs/smb2pdu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 062a2a5..c9489b1 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -1946,8 +1946,8 @@ int smb311_posix_mkdir(const unsigned int xid, struct inode *inode,
 	if (ses && (ses->server))
 		server = ses->server;
 	else {
-		goto err_free_path;
 		rc = -EIO;
+		goto err_free_path;
 	}
 
 	/* resource #2: request */
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-06-21 17:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-21 13:35 [PATCH] CIFS: fix structurally dead code in smb311_posix_mkdir Gustavo A. R. Silva
2018-06-21 16:59 ` Steve French
2018-06-21 17:36   ` Gustavo A. R. Silva

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.