Skip to content

Commit 8f45f08

Browse files
Dan Carpenterakpm00
authored andcommitted
ocfs2: fix double free in user_cluster_connect()
user_cluster_disconnect() frees "conn->cc_private" which is "lc" but then the error handling frees "lc" a second time. Set "lc" to NULL on this path to avoid a double free. Link: https://lkml.kernel.org/r/[email protected] Fixes: c994c2e ("ocfs2: use the new DLM operation callbacks while requesting new lockspace") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Joseph Qi <[email protected]> Reviewed-by: Goldwyn Rodrigues <[email protected]> Cc: Mark Fasheh <[email protected]> Cc: Joel Becker <[email protected]> Cc: Junxiao Bi <[email protected]> Cc: Changwei Ge <[email protected]> Cc: Jun Piao <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 99b70ec commit 8f45f08

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/ocfs2/stack_user.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,6 +1011,7 @@ static int user_cluster_connect(struct ocfs2_cluster_connection *conn)
10111011
printk(KERN_ERR "ocfs2: Could not determine"
10121012
" locking version\n");
10131013
user_cluster_disconnect(conn);
1014+
lc = NULL;
10141015
goto out;
10151016
}
10161017
wait_event(lc->oc_wait, (atomic_read(&lc->oc_this_node) > 0));

0 commit comments

Comments
 (0)