Skip to contentSkip to conversation

cifs: put tlink before return

PATCH New Pan Bian 1 participant 1 message Jan 20, 2021

Subsystems (2)
lore
Share & tools
lore

Pan Bian

author
#0 lore raw

PATCH 1/1 cifs: put tlink before return

Put tlink before returning error code.

Fixes 8ceb98437946 ("CIFS: Move rename to ops struct")
---
 fs/cifs/inode.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fs/cifs/inode.c +3 -1
index a83b3a8ffaac..9c31b6178638 100644
@@ -2020,8 +2020,10 @@ cifs_do_rename(const unsigned int xid, struct dentry *from_dentry,
 	tcon = tlink_tcon(tlink);
 	server = tcon->ses->server;
 
-	if (!server->ops->rename)
+	if (!server->ops->rename) {
+		cifs_put_tlink(tlink);
 		return -ENOSYS;
+	}
 
 	/* try path-based rename first */
 	rc = server->ops->rename(xid, tcon, from_path, to_path, cifs_sb);
Signature · 1 line
2.17.1