ocfs2: null deref on allocation error
authorDan Carpenter <error27@gmail.com>
Sun, 29 May 2011 19:57:16 +0000 (22:57 +0300)
committerJoel Becker <jlbec@evilplan.org>
Wed, 1 Jun 2011 02:03:45 +0000 (19:03 -0700)
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>
fs/ocfs2/ioctl.c

index bc91072b72196fd335c4b7cbc02ba08cb67254e6..d9a6ce7792669fedc66cfdbe26b6fe4d00976e59 100644 (file)
@@ -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))
@@ -431,7 +431,7 @@ bail:
                o2info_set_request_error(&oifi->ifi_req, req);
 
        kfree(oifi);
-
+out_err:
        return status;
 }
 
@@ -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))
@@ -716,7 +716,7 @@ bail:
                o2info_set_request_error(&oiff->iff_req, req);
 
        kfree(oiff);
-
+out_err:
        return status;
 }