fs: dlm: fix lowcomms_start error case
This patch fixes the error path handling in lowcomms_start(). We need to cleanup some static allocated data structure and cleanup possible workqueue if these have started. Signed-off-by: Alexander Aring <aahringo@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com>
This commit is contained in:
parent
7d3848c03e
commit
fcef0e6c27
@ -1803,10 +1803,15 @@ static void process_send_sockets(struct work_struct *work)
|
|||||||
|
|
||||||
static void work_stop(void)
|
static void work_stop(void)
|
||||||
{
|
{
|
||||||
if (recv_workqueue)
|
if (recv_workqueue) {
|
||||||
destroy_workqueue(recv_workqueue);
|
destroy_workqueue(recv_workqueue);
|
||||||
if (send_workqueue)
|
recv_workqueue = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (send_workqueue) {
|
||||||
destroy_workqueue(send_workqueue);
|
destroy_workqueue(send_workqueue);
|
||||||
|
send_workqueue = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int work_start(void)
|
static int work_start(void)
|
||||||
@ -1823,6 +1828,7 @@ static int work_start(void)
|
|||||||
if (!send_workqueue) {
|
if (!send_workqueue) {
|
||||||
log_print("can't start dlm_send");
|
log_print("can't start dlm_send");
|
||||||
destroy_workqueue(recv_workqueue);
|
destroy_workqueue(recv_workqueue);
|
||||||
|
recv_workqueue = NULL;
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1960,7 +1966,7 @@ int dlm_lowcomms_start(void)
|
|||||||
|
|
||||||
error = work_start();
|
error = work_start();
|
||||||
if (error)
|
if (error)
|
||||||
goto fail;
|
goto fail_local;
|
||||||
|
|
||||||
dlm_allow_conn = 1;
|
dlm_allow_conn = 1;
|
||||||
|
|
||||||
@ -1977,6 +1983,9 @@ int dlm_lowcomms_start(void)
|
|||||||
fail_unlisten:
|
fail_unlisten:
|
||||||
dlm_allow_conn = 0;
|
dlm_allow_conn = 0;
|
||||||
dlm_close_sock(&listen_con.sock);
|
dlm_close_sock(&listen_con.sock);
|
||||||
|
work_stop();
|
||||||
|
fail_local:
|
||||||
|
deinit_local();
|
||||||
fail:
|
fail:
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user