* [PATCH] cifs: put tlink before return
@ 2021-01-20 11:25 Pan Bian
0 siblings, 0 replies; only message in thread
From: Pan Bian @ 2021-01-20 11:25 UTC (permalink / raw)
To: Steve French, Pavel Shilovsky
Cc: linux-cifs, samba-technical, linux-kernel, Pan Bian
Put tlink before returning error code.
Fixes: 8ceb98437946 ("CIFS: Move rename to ops struct")
Signed-off-by: Pan Bian <bianpan2016@163.com>
---
fs/cifs/inode.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index a83b3a8ffaac..9c31b6178638 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -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);
--
2.17.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-01-20 19:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-20 11:25 [PATCH] cifs: put tlink before return Pan Bian
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).