public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [QUESTION] check for mem in slab
@ 2007-03-29 16:04 Cyrill Gorcunov
  2007-03-30  6:56 ` Heiko Carstens
  2007-04-02 10:18 ` [PATCH] Catch kmalloc() failure in kmem_cache_init() Johannes Weiner
  0 siblings, 2 replies; 7+ messages in thread
From: Cyrill Gorcunov @ 2007-03-29 16:04 UTC (permalink / raw)
  To: linux-kernel-list

Hi list,

in file mm/slab.c and routine kmem_cache_init() I found there
is no checking for allocated memory on line:

	/* 4) Replace the bootstrap head arrays */
	{
		struct array_cache *ptr;

		ptr = kmalloc(sizeof(struct arraycache_init), GFP_KERNEL);

--> no check for ptr == NULL <--

		local_irq_disable();
		BUG_ON(cpu_cache_get(&cache_cache) != &initarray_cache.cache);
		memcpy(ptr, cpu_cache_get(&cache_cache),
		       sizeof(struct arraycache_init));

		...

is that OK? or it's a bug?

		Cyrill


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

end of thread, other threads:[~2007-04-02 10:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-29 16:04 [QUESTION] check for mem in slab Cyrill Gorcunov
2007-03-30  6:56 ` Heiko Carstens
2007-03-30 11:55   ` Pekka Enberg
2007-03-30 16:41     ` Cyrill Gorcunov
2007-04-02  9:50     ` [PATCH] Catch kmalloc failure in kmem_cache_init() (was: [QUESTION] check for mem in slab) Johannes Weiner
2007-04-02 10:18 ` [PATCH] Catch kmalloc() failure in kmem_cache_init() Johannes Weiner
2007-04-02 10:23   ` Pekka J Enberg

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