Skip to content

Commit

Permalink
orangefs: some error code paths missed kmem_cache_free
Browse files Browse the repository at this point in the history
If a slab cache object is allocated, it needs to be freed eventually,
certainly before anyone unloads the module that allocated it.

Signed-off-by: Mike Marshall <hubcap@omnibond.com>
  • Loading branch information
hubcapsc committed Oct 18, 2018
1 parent b5d72cd commit 34e6148
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fs/orangefs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ static int orangefs_create(struct inode *dir,
goto out;

ref = new_op->downcall.resp.create.refn;
op_release(new_op);

inode = orangefs_new_inode(dir->i_sb, dir, S_IFREG | mode, 0, &ref);
if (IS_ERR(inode)) {
Expand Down Expand Up @@ -92,6 +91,7 @@ static int orangefs_create(struct inode *dir,
mark_inode_dirty_sync(dir);
ret = 0;
out:
op_release(new_op);
gossip_debug(GOSSIP_NAME_DEBUG,
"%s: %pd: returning %d\n",
__func__,
Expand Down Expand Up @@ -269,7 +269,6 @@ static int orangefs_symlink(struct inode *dir,
}

ref = new_op->downcall.resp.sym.refn;
op_release(new_op);

inode = orangefs_new_inode(dir->i_sb, dir, S_IFLNK | mode, 0, &ref);
if (IS_ERR(inode)) {
Expand Down Expand Up @@ -307,6 +306,7 @@ static int orangefs_symlink(struct inode *dir,
mark_inode_dirty_sync(dir);
ret = 0;
out:
op_release(new_op);
return ret;
}

Expand Down Expand Up @@ -346,7 +346,6 @@ static int orangefs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode
}

ref = new_op->downcall.resp.mkdir.refn;
op_release(new_op);

inode = orangefs_new_inode(dir->i_sb, dir, S_IFDIR | mode, 0, &ref);
if (IS_ERR(inode)) {
Expand Down Expand Up @@ -379,6 +378,7 @@ static int orangefs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode
orangefs_inode_setattr(dir, &iattr);
mark_inode_dirty_sync(dir);
out:
op_release(new_op);
return ret;
}

Expand Down

0 comments on commit 34e6148

Please sign in to comment.