]> git.baikalelectronics.ru Git - kernel.git/commit
Coccinelle: Script to detect incorrect argument to sizeof
authorHimangi Saraogi <himangi774@gmail.com>
Mon, 14 Jul 2014 17:34:10 +0000 (23:04 +0530)
committerMichal Marek <mmarek@suse.cz>
Wed, 6 Aug 2014 10:10:17 +0000 (12:10 +0200)
commit3155ae26ad43480a8af1d617031212f203036472
tree7b3be9ce6b8449d42c2b746b2ddf83800c5e5bec
parent6fa02482c71d97e2eb209f829d0ae8edf72e725d
Coccinelle: Script to detect incorrect argument to sizeof

This makes an effort to find cases where the argument to sizeof is wrong
in memory allocation functions by checking the type of the allocated
memory when it is a double pointer and ensuring the sizeof argument takes
a pointer to the the memory being allocated. There are false positives
in cases the sizeof argument is not used in constructing the return value.

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Michal Marek <mmarek@suse.cz>
scripts/coccinelle/misc/badty.cocci [new file with mode: 0644]