New check_stack.c: warn if kernel code puts too much data on the stack.
commit499b27bc72766852da610e1369beda857d679873
authorDan Carpenter <error27@gmail.com>
Mon, 8 Feb 2010 10:30:11 +0000 (8 13:30 +0300)
committerDan Carpenter <error27@gmail.com>
Mon, 8 Feb 2010 10:30:11 +0000 (8 13:30 +0300)
tree87fce6d03bddbc6a9bcafc3a7b713731139fe491
parent7b103820eee01118c71e8991865fd624cf1833f2
New check_stack.c:  warn if kernel code puts too much data on the stack.

For now the threshold is 500 bytes on the stack.  If you put more than
than that on the stack smatch will complain.

This has some false positives in handling typedefed pointers to aligned data.

typedef struct aligned_struct {
        int a;
}  __attribute__ ((aligned(1024))) ali_t;

...
        ali_t *ptr;  // smatch thinks ptr is aligned when really we want
                     // the data ptr points at to be aligned.
...

Signed-off-by: Dan Carpenter <error27@gmail.com>
check_list.h
check_stack.c [new file with mode: 0644]