All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ilya Dryomov <ilya.dryomov@inktank.com>
To: Alex Elder <elder@ieee.org>
Cc: roy.qing.li@gmail.com, Sage Weil <sage@inktank.com>,
	Ceph Development <ceph-devel@vger.kernel.org>
Subject: Re: [PATCH] libceph: fix a memory leak in handle_watch_notify
Date: Thu, 11 Sep 2014 15:11:10 +0400	[thread overview]
Message-ID: <CALFYKtAfX=B8O7W7pFZ_r-GspKpB_x8GiiSwWT2EpUmwPwr_cA@mail.gmail.com> (raw)
In-Reply-To: <54117E61.6080004@ieee.org>

On Thu, Sep 11, 2014 at 2:50 PM, Alex Elder <elder@ieee.org> wrote:
> On 09/11/2014 03:31 AM, Ilya Dryomov wrote:
>>
>> On Thu, Sep 11, 2014 at 5:41 AM, Alex Elder <elder@ieee.org> wrote:
>>>
>>> On 09/10/2014 07:20 PM, roy.qing.li@gmail.com wrote:
>>>>
>>>>
>>>> From: Li RongQing <roy.qing.li@gmail.com>
>>>>
>>>> event_work should be freed when adding it to queue failed
>>>>
>>>> Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
>>>
>>>
>>>
>>> Looks good.
>>>
>>> Reviewed-by: Alex Elder <elder@linaro.org>
>>
>>
>> Hmm, queue_work() returns %false if @work was already on a queue, %true
>> otherwise, so this seems bogus to me.  I'd go with something like this
>> (mangled).
>
>
> The original change was fine.  Whether it matters is another question.
> Your suggestion looks good as well, and on the assumption that if you
> choose to use it instead your "real" fix is done correctly you can
> use "Reviewed-by: <me>" if you like.

Well, the original change makes something bogus even more bogus.  It's
basically:

    foo = kmalloc(...);
    foo->bar = 0;

    if (foo->bar & BAZ) {
        /* WARNING */
        kfree(foo);
        goto ...
    }

So yeah, I'm going to use your Reviewed-by on my "real" fix ;)

Thanks,

                Ilya

      reply	other threads:[~2014-09-11 11:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-11  0:20 [PATCH] libceph: fix a memory leak in handle_watch_notify roy.qing.li
2014-09-11  1:41 ` Alex Elder
2014-09-11  8:31   ` Ilya Dryomov
2014-09-11 10:50     ` Alex Elder
2014-09-11 11:11       ` Ilya Dryomov [this message]

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='CALFYKtAfX=B8O7W7pFZ_r-GspKpB_x8GiiSwWT2EpUmwPwr_cA@mail.gmail.com' \
    --to=ilya.dryomov@inktank.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=elder@ieee.org \
    --cc=roy.qing.li@gmail.com \
    --cc=sage@inktank.com \
    /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.