aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/cluster/tcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/cluster/tcp.c')
-rw-r--r--fs/ocfs2/cluster/tcp.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c
index ea34952f9496..56cebba2390c 100644
--- a/fs/ocfs2/cluster/tcp.c
+++ b/fs/ocfs2/cluster/tcp.c
@@ -2146,17 +2146,13 @@ int o2net_init(void)
2146 o2quo_init(); 2146 o2quo_init();
2147 2147
2148 if (o2net_debugfs_init()) 2148 if (o2net_debugfs_init())
2149 return -ENOMEM; 2149 goto out;
2150 2150
2151 o2net_hand = kzalloc(sizeof(struct o2net_handshake), GFP_KERNEL); 2151 o2net_hand = kzalloc(sizeof(struct o2net_handshake), GFP_KERNEL);
2152 o2net_keep_req = kzalloc(sizeof(struct o2net_msg), GFP_KERNEL); 2152 o2net_keep_req = kzalloc(sizeof(struct o2net_msg), GFP_KERNEL);
2153 o2net_keep_resp = kzalloc(sizeof(struct o2net_msg), GFP_KERNEL); 2153 o2net_keep_resp = kzalloc(sizeof(struct o2net_msg), GFP_KERNEL);
2154 if (!o2net_hand || !o2net_keep_req || !o2net_keep_resp) { 2154 if (!o2net_hand || !o2net_keep_req || !o2net_keep_resp)
2155 kfree(o2net_hand); 2155 goto out;
2156 kfree(o2net_keep_req);
2157 kfree(o2net_keep_resp);
2158 return -ENOMEM;
2159 }
2160 2156
2161 o2net_hand->protocol_version = cpu_to_be64(O2NET_PROTOCOL_VERSION); 2157 o2net_hand->protocol_version = cpu_to_be64(O2NET_PROTOCOL_VERSION);
2162 o2net_hand->connector_id = cpu_to_be64(1); 2158 o2net_hand->connector_id = cpu_to_be64(1);
@@ -2181,6 +2177,14 @@ int o2net_init(void)
2181 } 2177 }
2182 2178
2183 return 0; 2179 return 0;
2180
2181out:
2182 kfree(o2net_hand);
2183 kfree(o2net_keep_req);
2184 kfree(o2net_keep_resp);
2185
2186 o2quo_exit();
2187 return -ENOMEM;
2184} 2188}
2185 2189
2186void o2net_exit(void) 2190void o2net_exit(void)