Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1161893

Re: [RFC][PATCH 0/5] do not dereference NULL pools in pools' destroy() functions

From Christoph Lameter <cl@linux.com>
Newsgroups linux.kernel
Subject Re: [RFC][PATCH 0/5] do not dereference NULL pools in pools' destroy() functions
Date 2015-06-10 03:20 +0200
Message-ID <pzCQp-7qt-5@gated-at.bofh.it> (permalink)
References <pzqvT-682-7@gated-at.bofh.it> <pzzfQ-246-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, 9 Jun 2015, Andrew Morton wrote:

> Well I like it, even though it's going to cause a zillion little cleanup
> patches.
>
> checkpatch already has a "kfree(NULL) is safe and this check is
> probably not required" test so I guess Joe will need to get busy ;)
>
> I'll park these patches until after 4.1 is released - it's getting to
> that time...

Why do this at all? I understand that kfree/kmem_cache_free can take a
null pointer but this is the destruction of a cache and it usually
requires multiple actions to clean things up and these actions have to be
properly sequenced. All other processors have to stop referencing this
cache before it can be destroyed. I think failing if someone does
something strange like doing cache destruction with a NULL pointer is
valuable.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [RFC][PATCH 0/5] do not dereference NULL pools in pools' destroy()  functions Christoph Lameter <cl@linux.com> - 2015-06-10 03:20 +0200
  Re: [RFC][PATCH 0/5] do not dereference NULL pools in pools'  destroy() functions Andrew Morton <akpm@linux-foundation.org> - 2015-06-10 03:50 +0200
    Re: [RFC][PATCH 0/5] do not dereference NULL pools in pools' destroy()  functions Christoph Lameter <cl@linux.com> - 2015-06-10 04:10 +0200
      Re: [RFC][PATCH 0/5] do not dereference NULL pools in pools'  destroy() functions Andrew Morton <akpm@linux-foundation.org> - 2015-06-10 04:20 +0200
  Re: [RFC][PATCH 0/5] do not dereference NULL pools in pools'  destroy() functions Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2015-06-10 04:10 +0200

csiph-web