*new* check_struct_type: if we allocate an unexpected type of struct
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 14 Feb 2013 12:13:32 +0000 (15:13 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Thu, 14 Feb 2013 12:13:32 +0000 (15:13 +0300)
commit4302101de40c19742faed379be73bd67a89b430b
tree94eb553968dc47031d67fdc94f82cfcdb423486a
parentcab6b64be82dbeac96a006d6c8cd66fc407eff0d
*new* check_struct_type: if we allocate an unexpected type of struct

Complain about code like this:

struct foo *p;

p = kmalloc(sizeof(struct bar), GFP_KERNEL);

These are mostly real bugs, but they are allocating more memory than we
need not less.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
check_list.h
check_struct_type.c [new file with mode: 0644]