All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oren Laadan <orenl-RdfvBDnrOixBDgjK7y7TUQ@public.gmane.org>
To: Matt Helsley <matthltc-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Cc: Containers
	<containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
Subject: Re: [PATCH 1/2] Check for valid destructor pointer before calling it.
Date: Thu, 20 Aug 2009 08:28:21 -0400	[thread overview]
Message-ID: <4A8D4165.4080708@librato.com> (raw)
In-Reply-To: <6d896e12f316e5ff5f44bd13ae1482dab7f9253a.1250745409.git.matthltc-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>



Matt Helsley wrote:
> Not every use of deferqueue will have a destructor function so
> we need to check it before calling it.
> 
> Signed-off-by: Matt Helsley <matthltc-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>

Yup.

Acked-by: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>

> ---
>  kernel/deferqueue.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/kernel/deferqueue.c b/kernel/deferqueue.c
> index 3fb388b..1204c8b 100644
> --- a/kernel/deferqueue.c
> +++ b/kernel/deferqueue.c
> @@ -53,7 +53,8 @@ void deferqueue_destroy(struct deferqueue_head *h)
>  
>  		pr_debug("%s: freeing non-empty queue\n", __func__);
>  		list_for_each_entry_safe(dq, n, &h->list, list) {
> -			dq->destructor(dq->data);
> +			if (dq->destructor)
> +				dq->destructor(dq->data);
>  			list_del(&dq->list);
>  			kfree(dq);
>  		}

  parent reply	other threads:[~2009-08-20 12:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-20  5:17 [PATCH 1/2] Check for valid destructor pointer before calling it Matt Helsley
     [not found] ` <6d896e12f316e5ff5f44bd13ae1482dab7f9253a.1250745409.git.matthltc-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-08-20  5:17   ` [PATCH 2/2] [RFC] Add checkpoint/restart support for epoll files Matt Helsley
     [not found]     ` <e820d207a3b1a3228ded29bce9b29f2179ab598b.1250745409.git.matthltc-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-08-20 16:33       ` Oren Laadan
     [not found]         ` <4A8D7AE2.1030705-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2009-08-25  5:17           ` Matt Helsley
     [not found]             ` <20090825051723.GD8078-52DBMbEzqgQ/wnmkkaCWp/UQ3DHhIser@public.gmane.org>
2009-08-25 17:42               ` Oren Laadan
     [not found]                 ` <4A94227C.9050101-RdfvBDnrOixBDgjK7y7TUQ@public.gmane.org>
2009-08-26  9:00                   ` Matt Helsley
2009-08-24 21:27       ` Serge E. Hallyn
     [not found]         ` <20090824212725.GA25030-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-08-25  2:01           ` Matt Helsley
     [not found]             ` <20090825020146.GC8078-52DBMbEzqgQ/wnmkkaCWp/UQ3DHhIser@public.gmane.org>
2009-08-25  4:17               ` Oren Laadan
     [not found]                 ` <4A9365C4.3010305-RdfvBDnrOixBDgjK7y7TUQ@public.gmane.org>
2009-08-25 12:09                   ` Matt Helsley
2009-08-20 12:28   ` Oren Laadan [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-09-28 19:01 [PATCH 1/2] Check for valid destructor pointer before calling it Matt Helsley
     [not found] ` <1254164482-2193-1-git-send-email-matthltc-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-09-29 19:53   ` Serge E. Hallyn
2009-09-29 23:34   ` Oren Laadan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A8D4165.4080708@librato.com \
    --to=orenl-rdfvbdnroixbdgjk7y7tuq@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=matthltc-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.