Revision e3854b6e25d1b092c30c5f81a04fe6fc839b1e26 authored by Julia Lawall on 08 August 2011, 11:18:02 UTC, committed by Kumar Gala on 24 November 2011, 08:01:24 UTC
At this point, ehv_pic has been allocated but not stored anywhere, so it should be freed before leaving the function. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @exists@ local idexpression x; statement S,S1; expression E; identifier fl; expression *ptr != NULL; @@ x = \(kmalloc\|kzalloc\|kcalloc\)(...); ... if (x == NULL) S <... when != x when != if (...) { <+...kfree(x)...+> } when any when != true x == NULL x->fl ...> ( if (x == NULL) S1 | if (...) { ... when != x when forall ( return \(0\|<+...x...+>\|ptr\); | * return ...; ) } ) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Acked-by: Timur Tabi <timur@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
1 parent 7145cf1
File | Mode | Size |
---|---|---|
apparmor | ||
integrity | ||
keys | ||
selinux | ||
smack | ||
tomoyo | ||
Kconfig | -rw-r--r-- | 7.9 KB |
Makefile | -rw-r--r-- | 941 bytes |
capability.c | -rw-r--r-- | 23.3 KB |
commoncap.c | -rw-r--r-- | 27.4 KB |
device_cgroup.c | -rw-r--r-- | 11.4 KB |
inode.c | -rw-r--r-- | 8.7 KB |
lsm_audit.c | -rw-r--r-- | 8.9 KB |
min_addr.c | -rw-r--r-- | 1.3 KB |
security.c | -rw-r--r-- | 33.6 KB |
Computing file changes ...