Skip to content

Commit

Permalink
ocfs2: Fix check of return value of ocfs2_start_trans() in xattr.c.
Browse files Browse the repository at this point in the history
On failure, ocfs2_start_trans() returns values like ERR_PTR(-ENOMEM),
so we should check whether handle is NULL. Fix them to use IS_ERR().
Jan has made the patch for other part in ocfs2(thank Jan for it), so
this is just the fix for fs/ocfs2/xattr.c.

Signed-off-by: Tao Ma <tao.ma@oracle.com>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
  • Loading branch information
Tao Ma authored and Mark Fasheh committed Nov 10, 2008
1 parent b99835c commit d326479
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/ocfs2/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -4092,7 +4092,7 @@ static int ocfs2_xattr_value_update_size(struct inode *inode,
handle_t *handle = NULL;

handle = ocfs2_start_trans(osb, 1);
if (handle == NULL) {
if (IS_ERR(handle)) {
ret = -ENOMEM;
mlog_errno(ret);
goto out;
Expand Down Expand Up @@ -4259,7 +4259,7 @@ static int ocfs2_rm_xattr_cluster(struct inode *inode,
}

handle = ocfs2_start_trans(osb, OCFS2_REMOVE_EXTENT_CREDITS);
if (handle == NULL) {
if (IS_ERR(handle)) {
ret = -ENOMEM;
mlog_errno(ret);
goto out;
Expand Down

0 comments on commit d326479

Please sign in to comment.