public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] slub: remove impossible condition
@ 2010-01-15 20:49 David Rientjes
  2010-01-15 23:38 ` Christoph Lameter
  0 siblings, 1 reply; 3+ messages in thread
From: David Rientjes @ 2010-01-15 20:49 UTC (permalink / raw)
  To: Pekka Enberg; +Cc: Christoph Lameter, linux-kernel

`s' cannot be NULL if kmalloc_caches is not NULL.

This conditional would trigger a NULL pointer on `s', anyway, since it is
immediately derefernced if true.

Cc: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: David Rientjes <rientjes@google.com>
---
 mm/slub.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2641,7 +2641,7 @@ static noinline struct kmem_cache *dma_kmalloc_cache(int index, gfp_t flags)
 	if (slab_state >= SYSFS)
 		slabflags |= __SYSFS_ADD_DEFERRED;
 
-	if (!s || !text || !kmem_cache_open(s, flags, text,
+	if (!text || !kmem_cache_open(s, flags, text,
 			realsize, ARCH_KMALLOC_MINALIGN, slabflags, NULL)) {
 		s->size = 0;
 		kfree(text);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] slub: remove impossible condition
  2010-01-15 20:49 [patch] slub: remove impossible condition David Rientjes
@ 2010-01-15 23:38 ` Christoph Lameter
  2010-01-22 16:36   ` Pekka Enberg
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Lameter @ 2010-01-15 23:38 UTC (permalink / raw)
  To: David Rientjes; +Cc: Pekka Enberg, linux-kernel

On Fri, 15 Jan 2010, David Rientjes wrote:

> `s' cannot be NULL if kmalloc_caches is not NULL.
>
> This conditional would trigger a NULL pointer on `s', anyway, since it is
> immediately derefernced if true.

Ok that was caused by the patches for the dma kmalloc in the -next tree.

Acked-by: Christoph Lameter <cl@linux-foundation.org>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] slub: remove impossible condition
  2010-01-15 23:38 ` Christoph Lameter
@ 2010-01-22 16:36   ` Pekka Enberg
  0 siblings, 0 replies; 3+ messages in thread
From: Pekka Enberg @ 2010-01-22 16:36 UTC (permalink / raw)
  To: Christoph Lameter; +Cc: David Rientjes, linux-kernel

Christoph Lameter wrote:
> On Fri, 15 Jan 2010, David Rientjes wrote:
> 
>> `s' cannot be NULL if kmalloc_caches is not NULL.
>>
>> This conditional would trigger a NULL pointer on `s', anyway, since it is
>> immediately derefernced if true.
> 
> Ok that was caused by the patches for the dma kmalloc in the -next tree.
> 
> Acked-by: Christoph Lameter <cl@linux-foundation.org>

Applied, thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-01-22 16:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-15 20:49 [patch] slub: remove impossible condition David Rientjes
2010-01-15 23:38 ` Christoph Lameter
2010-01-22 16:36   ` Pekka Enberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox