Skip to content

Commit

Permalink
ocfs2: null deref on allocation error
Browse files Browse the repository at this point in the history
The original code had a null derefence in the error handling.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Joel Becker <jlbec@evilplan.org>
  • Loading branch information
Dan Carpenter authored and Joel Becker committed Jun 1, 2011
1 parent 3d75be7 commit 87f0d5c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fs/ocfs2/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ int ocfs2_info_handle_freeinode(struct inode *inode,
if (!oifi) {
status = -ENOMEM;
mlog_errno(status);
goto bail;
goto out_err;
}

if (o2info_from_user(*oifi, req))
Expand Down Expand Up @@ -431,7 +431,7 @@ int ocfs2_info_handle_freeinode(struct inode *inode,
o2info_set_request_error(&oifi->ifi_req, req);

kfree(oifi);

out_err:
return status;
}

Expand Down Expand Up @@ -666,7 +666,7 @@ int ocfs2_info_handle_freefrag(struct inode *inode,
if (!oiff) {
status = -ENOMEM;
mlog_errno(status);
goto bail;
goto out_err;
}

if (o2info_from_user(*oiff, req))
Expand Down Expand Up @@ -716,7 +716,7 @@ int ocfs2_info_handle_freefrag(struct inode *inode,
o2info_set_request_error(&oiff->iff_req, req);

kfree(oiff);

out_err:
return status;
}

Expand Down

0 comments on commit 87f0d5c

Please sign in to comment.