All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: linux-block@vger.kernel.org
Subject: Re: [PATCH] blkcg: check pol->cpd_free_fn before free cpd
Date: Tue, 10 Oct 2017 09:04:39 -0600	[thread overview]
Message-ID: <e161a324-40ba-fac8-d0e0-65b63ea8ceaf@kernel.dk> (raw)
In-Reply-To: <20171010145342.GA24247@localhost.didichuxing.com>

On 10/10/2017 08:53 AM, weiping zhang wrote:
> check pol->cpd_free_fn() instead of pol->cpd_alloc_fn() when free cpd.

In practice this shouldn't make a difference, since if you have an
alloc_fn, you better also have a free_fn. I'd argue a better
patch would be ensuring that's the case, since the current situation
would at least oops and show you there's an issue, but with the patch
we'll just leak the memory.

I'll apply it, but would be nice if this was handled a bit more
proactively.

-- 
Jens Axboe

  parent reply	other threads:[~2017-10-10 15:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-10 14:53 [PATCH] blkcg: check pol->cpd_free_fn before free cpd weiping zhang
2017-10-10 14:59 ` Johannes Thumshirn
2017-10-10 15:04 ` Jens Axboe [this message]
2017-10-10 15:44   ` weiping zhang
  -- strict thread matches above, loose matches on Subject: below --
2017-08-29 16:08 weiping zhang

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=e161a324-40ba-fac8-d0e0-65b63ea8ceaf@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.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.