android_kernel_motorola_sm6225/drivers/xen
Julia Lawall 2e16341438 xen-gntalloc: introduce missing kfree
Error handling code following a kmalloc should free the allocated data.
Out_unlock is used on both success and failure, so free vm_priv before
jumping to that label.

A simplified version of the semantic match that finds the problem is as
follows: (http://coccinelle.lip6.fr)

// <smpl>
@r exists@
local idexpression x;
statement S;
identifier f1;
position p1,p2;
expression *ptr != NULL;
@@

x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
...
if (x == NULL) S
<... when != x
     when != if (...) { <+...x...+> }
x->f1
...>
(
 return \(0\|<+...x...+>\|ptr\);
|
 return@p2 ...;
)

@script:python@
p1 << r.p1;
p2 << r.p2;
@@

print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
[v1: Altered the description a bit]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2012-01-03 13:39:04 -05:00
..
xen-pciback xen: Add module.h to modular drivers/xen users. 2011-10-31 19:32:11 -04:00
xenbus xen/xenbus: Fix compile error - missing header for xen_initial_domain() 2011-12-21 14:32:50 -05:00
xenfs xen: Add xenbus device driver 2011-12-16 13:29:39 -05:00
balloon.c xen/balloon: Avoid OOM when requesting highmem 2011-11-16 12:13:43 -05:00
biomerge.c xen: define BIOVEC_PHYS_MERGEABLE() 2010-10-18 10:40:28 -04:00
cpu_hotplug.c Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6 2009-12-11 12:18:16 -08:00
events.c xen/events: prevent calling evtchn_get on invalid channels 2011-12-16 11:25:54 -05:00
evtchn.c xen/event: Add reference counting to event channels 2011-11-21 17:14:48 -05:00
features.c xen: clean up asm/xen/hypervisor.h 2008-12-16 21:50:31 +01:00
gntalloc.c xen-gntalloc: introduce missing kfree 2012-01-03 13:39:04 -05:00
gntdev.c xen/grant-table: Support mappings required by blkback 2011-12-20 17:07:27 -05:00
grant-table.c xen/grant-table: Support mappings required by blkback 2011-12-20 17:07:27 -05:00
Kconfig xen: Add privcmd device driver 2011-12-16 13:29:31 -05:00
Makefile xen: Add privcmd device driver 2011-12-16 13:29:31 -05:00
manage.c xen: Add export.h for THIS_MODULE/EXPORT_SYMBOL to various xen users. 2011-10-31 19:32:11 -04:00
pci.c Merge branch 'stable/cleanups-3.2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen 2011-11-06 20:13:34 -08:00
platform-pci.c xen: no need to delay xen_setup_shutdown_event for hvm guests anymore 2011-02-25 16:43:03 +00:00
privcmd.c xen/privcmd: Remove unused support for arch specific privcmp mmap 2011-12-16 13:29:42 -05:00
privcmd.h xen: Add privcmd device driver 2011-12-16 13:29:31 -05:00
swiotlb-xen.c xen: Add export.h for THIS_MODULE/EXPORT_SYMBOL to various xen users. 2011-10-31 19:32:11 -04:00
sys-hypervisor.c drivers/xen/sys-hypervisor: Cleanup code/data sections definitions 2011-05-19 11:30:41 -04:00
tmem.c xen: prepare tmem shim to handle frontswap 2011-06-17 15:06:20 -06:00
xen-balloon.c xen: use static initializers in xen-balloon.c 2011-07-29 13:45:45 -04:00
xen-selfballoon.c Merge branches 'stable/bug.fixes-3.2' and 'stable/mmu.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen 2011-10-25 09:17:47 +02:00
xencomm.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00