提交 abf9767c 编写于 作者: C Christian Engelmayer 提交者: Steve French

cifs: Fix memory leak in cifs_hardlink()

Fix a potential memory leak in the cifs_hardlink() error handling path.
Detected by Coverity: CID 728510, CID 728511.
Signed-off-by: NChristian Engelmayer <cengelma@gmx.at>
Signed-off-by: NSteve French <smfrench@gmail.com>
上级 d8ec26d7
......@@ -438,8 +438,10 @@ cifs_hardlink(struct dentry *old_file, struct inode *inode,
CIFS_MOUNT_MAP_SPECIAL_CHR);
else {
server = tcon->ses->server;
if (!server->ops->create_hardlink)
return -ENOSYS;
if (!server->ops->create_hardlink) {
rc = -ENOSYS;
goto cifs_hl_exit;
}
rc = server->ops->create_hardlink(xid, tcon, from_name, to_name,
cifs_sb);
if ((rc == -EIO) || (rc == -EINVAL))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册