linux/drivers/char/hw_random
Julia Lawall c652759b6a hwrng: omap - Convert release_resource to release_region/release_mem_region
Request_region should be used with release_region, not release_resource.

The local variable mem, storing the result of request_mem_region, is
dropped and instead the pointer res is stored in the drvdata field of the
platform device.  This information is retrieved in omap_rng_remove to
release the region.  The drvdata field is not used elsewhere.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x,E;
@@
(
*x = request_region(...)
|
*x = request_mem_region(...)
)
... when != release_region(x)
    when != x = E
* release_resource(x);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2011-02-16 13:05:54 +11:00
..
amd-rng.c hwrng: Use PCI_VDEVICE 2009-06-25 13:50:53 +08:00
core.c BKL: remove extraneous #include <smp_lock.h> 2010-11-17 08:59:32 -08:00
geode-rng.c hwrng: Use PCI_VDEVICE 2009-06-25 13:50:53 +08:00
intel-rng.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
ixp4xx-rng.c [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach 2008-08-07 09:55:48 +01:00
Kconfig hwrng: pixocell - add support for picoxcell TRNG 2011-01-23 18:59:19 +11:00
Makefile hwrng: pixocell - add support for picoxcell TRNG 2011-01-23 18:59:19 +11:00
mxc-rnga.c i.MX31: Add hw-random for RNGA 2009-05-07 16:17:16 +02:00
n2-asm.S sparc64: Add Niagara2 RNG driver. 2008-07-18 00:46:09 -07:00
n2-drv.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2010-09-07 14:35:16 -07:00
n2rng.h of/device: Replace struct of_device with struct platform_device 2010-08-06 09:25:50 -06:00
nomadik-rng.c ARM: 6137/1: nomadik hwrng: Add clock support 2010-05-20 23:51:07 +01:00
octeon-rng.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
omap-rng.c hwrng: omap - Convert release_resource to release_region/release_mem_region 2011-02-16 13:05:54 +11:00
pasemi-rng.c of/device: Replace struct of_device with struct platform_device 2010-08-06 09:25:50 -06:00
picoxcell-rng.c hwrng: pixocell - add support for picoxcell TRNG 2011-01-23 18:59:19 +11:00
timeriomem-rng.c hwrng: timeriomem - Fix potential oops (request_mem_region/__devinit) 2009-06-03 19:28:03 +10:00
tx4939-rng.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
via-rng.c hwrng: via_rng - Fix memory scribbling on some CPUs 2011-01-07 14:55:06 +11:00
virtio-rng.c virtio-rng: use virtqueue_xxx wrappers 2010-05-19 22:15:45 +09:30