Commit ae1a7381 authored by Kevin Corry's avatar Kevin Corry Committed by Linus Torvalds

[PATCH] dm: kcopyd.c: make client_add() return void

kcopyd.c: client_add() can return void instead of an int, which will eliminate
an unnecessary error path in kcopyd_client_create().
Signed-off-by: default avatarKevin Corry <kevcorry@us.ibm.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f6a5f1f8
......@@ -573,12 +573,11 @@ int kcopyd_cancel(struct kcopyd_job *job, int block)
static DECLARE_MUTEX(_client_lock);
static LIST_HEAD(_clients);
static int client_add(struct kcopyd_client *kc)
static void client_add(struct kcopyd_client *kc)
{
down(&_client_lock);
list_add(&kc->list, &_clients);
up(&_client_lock);
return 0;
}
static void client_del(struct kcopyd_client *kc)
......@@ -668,15 +667,7 @@ int kcopyd_client_create(unsigned int nr_pages, struct kcopyd_client **result)
return r;
}
r = client_add(kc);
if (r) {
dm_io_put(nr_pages);
client_free_pages(kc);
kfree(kc);
kcopyd_exit();
return r;
}
client_add(kc);
*result = kc;
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment