Messages in this thread | | | Date | Sun, 27 Jan 2008 22:30:10 +0100 | From | "Vegard Nossum" <> | Subject | Re: lib/idr.c: initialize struct idr_layer |
| |
On Jan 27, 2008 10:21 PM, Pekka J Enberg <penberg@cs.helsinki.fi> wrote: > On Sun, 27 Jan 2008, Vegard Nossum wrote: > > Though in this case, idr_pre_get() actually *is* called first. Hmm... > > I think there's a pretty big chance that kmemcheck is at fault :-( > > Depends on how you track object initialization. An object returned by > kmem_cache_alloc() is always initialized if the cache it comes from has a > constructor.
I think there's a pretty big chance I'm wrong (or misunderstanding something) here, so I'll just ask: setup_object() from mm/slub.c is what calls the ctor. Shouldn't this be called from slab_alloc() as well? (I'm marking the data "uninitialized" there before returning the object.) Otherwise you might get back an object that is initialized with the previous owner's data. Or is this intentional?
Thanks.
Vegard
| |