[Devel] Re: [PATCH] Fixes for the deferqueue_add() function (v2)
Oren Laadan
orenl at cs.columbia.edu
Wed Jun 24 09:38:25 PDT 2009
Dan Smith wrote:
> I'm not sure how the deferqueue would (or has ever) worked without these
> modifications, but I had to make them in order to use it :)
>
> Changes (v2):
> - Remove unnecessary initialization of the new list item
>
> Cc: orenl at cs.columbia.edu
> Signed-off-by: Dan Smith <danms at us.ibm.com>
Of course... added.
Thanks,
Oren.
> ---
> kernel/deferqueue.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/deferqueue.c b/kernel/deferqueue.c
> index efd99d5..3fb388b 100644
> --- a/kernel/deferqueue.c
> +++ b/kernel/deferqueue.c
> @@ -66,7 +66,7 @@ int deferqueue_add(struct deferqueue_head *head, void *data, int size,
> {
> struct deferqueue_entry *dq;
>
> - dq = kmalloc(sizeof(dq) + size, GFP_KERNEL);
> + dq = kmalloc(sizeof(*dq) + size, GFP_KERNEL);
> if (!dq)
> return -ENOMEM;
>
> @@ -77,7 +77,7 @@ int deferqueue_add(struct deferqueue_head *head, void *data, int size,
> pr_debug("%s: adding work %p func %p dtor %p\n",
> __func__, dq, func, dtor);
> spin_lock(&head->lock);
> - list_add_tail(&head->list, &dq->list);
> + list_add_tail(&dq->list, &head->list);
> spin_unlock(&head->lock);
> return 0;
> }
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
More information about the Devel
mailing list