summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChristian Engelmayer <cengelma@gmx.at>2014-01-11 01:57:22 +0100
committerSteve French <smfrench@gmail.com>2014-01-19 23:58:18 -0600
commitabf9767c823bf57837c2032f21332a6efc38a13e (patch)
tree601c90d4f541e0f2399f6dc2b400460c3c62a731 /fs
parentd8ec26d7f8287f5788a494f56e8814210f0e64be (diff)
downloadop-kernel-dev-abf9767c823bf57837c2032f21332a6efc38a13e.zip
op-kernel-dev-abf9767c823bf57837c2032f21332a6efc38a13e.tar.gz
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: Christian Engelmayer <cengelma@gmx.at> Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/link.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/cifs/link.c b/fs/cifs/link.c
index 92aee08..28bc8ee9 100644
--- a/fs/cifs/link.c
+++ b/fs/cifs/link.c
@@ -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))
OpenPOWER on IntegriCloud