Skip to contentSkip to conversation

ocfs2: null deref on allocation error

PATCH In review Dan Carpenter 2 participants 2 messages May 29, 2011 – Jun 1, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ocfs2: null deref on allocation error

The original code had a null derefence in the error handling.

fs/ocfs2/ioctl.c +4 -4
index bc91072..d9a6ce7 100644
@@ -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;
 }
 
maintainer
#1 lore raw
Quoted 3 lines · Dan Carpenter

The original code had a null derefence in the error handling.

This patch is now in the 'fixes' branch of ocfs2.git.

Joel

Signature · 6 lines
"The trouble with being punctual is that nobody's there to
 appreciate it."
	- Franklin P. Jones

			http://www.jlbec.org/
			[email protected]