@@ -258,7 +258,7 @@ cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned int xid,
CIFSSMBClose(xid, tcon, fid->netfid);
iput(newinode);
rc = -EISDIR;
- goto out;
+ goto free_path;
}
if (!S_ISREG(newinode->i_mode)) {
@@ -301,7 +301,7 @@ cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned int xid,
break;
default:
- goto out;
+ goto free_path;
}
/*
* fallthrough to retry, using older open call, this is case
@@ -334,13 +334,13 @@ cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned int xid,
if (!server->ops->open) {
rc = -ENOSYS;
- goto out;
+ goto free_path;
}
buf = kmalloc(sizeof(*buf), GFP_KERNEL);
if (buf == NULL) {
rc = -ENOMEM;
- goto out;
+ goto free_path;
}
/*
@@ -444,6 +444,7 @@ cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned int xid,
out:
kfree(buf);
+free_path:
kfree(full_path);
return rc;