Re: [PATCH 07/10] Remove some of the kmemleak false positives

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/11/06, Catalin Marinas <[email protected]> wrote:
@@ -166,6 +166,9 @@ struct platform_device *platform_device_
        struct platform_object *pa;

        pa = kzalloc(sizeof(struct platform_object) + strlen(name), GFP_KERNEL);
+       /* kmemleak cannot guess the object type because the block
+        * size is different from the object size */
+       memleak_typeid(pa, struct platform_object);

AFAICT, we about 300 kmalloc and kzalloc calls in the kernel that
would need this annotation. If we really can't fix the detector to
deal with these, I would prefer we introduce another memory allocator
function such as:

   void *kzalloc_extra(size_t obj_size, size_t nr_extra, gfp_t flags);

That would do the right thing for memleak too.

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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux