summaryrefslogtreecommitdiff
path: root/drivers/dca
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2009-02-09 00:45:24 +0300
committerJesse Barnes <jbarnes@hobbes.lan>2009-03-20 05:29:28 +0300
commit0b3e7388e3b438500aaa0630879ce536747a47ca (patch)
treed24efd66fd015ec72dcf4b10bef69b3a27cd9963 /drivers/dca
parent1c35b8e538cb6259accb215099cdb673310cad84 (diff)
downloadlinux-0b3e7388e3b438500aaa0630879ce536747a47ca.tar.xz
PCI: introduce missing kfree
Error handling code following a kmalloc should free the allocated data. Since the subsequent code that could provoke an error does not use the allocated data, the allocation is just moved below it. The semantic match that finds the problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @r exists@ local idexpression x; statement S; expression E; identifier f,l; position p1,p2; expression *ptr != NULL; @@ ( if ((x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...)) == NULL) S | x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...); ... if (x == NULL) S ) <... when != x when != if (...) { <+...x...+> } x->f = E ...> ( 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> Reviewed-by: Matthew Wilcox <willy@linux.intel.com> Reviewed-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/dca')
0 files changed, 0 insertions, 0 deletions