]> git.karo-electronics.de Git - karo-tx-linux.git/commit
drivers/watchdog/lantiq_wdt.c: drop iounmap for devm_ allocated data
authorJulia Lawall <julia@diku.dk>
Mon, 26 Dec 2011 17:38:00 +0000 (18:38 +0100)
committerWim Van Sebroeck <wim@iguana.be>
Fri, 6 Jan 2012 14:27:30 +0000 (15:27 +0100)
commit60daac4a9084d5a6216443f428d0060c42eb44ff
treec36fe26d452c044e458ff35cf5118ea67e5f84b2
parent02861cca4b4f1ceaa7dc805041d84caee580670b
drivers/watchdog/lantiq_wdt.c: drop iounmap for devm_ allocated data

Data allocated with devm_ioremap or devm_ioremap_nocache should not be
freed using iounmap, because doing so causes a dangling pointer, and a
subsequent double free.

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

// <smpl>
@r@
expression x;
@@
(
 x = devm_ioremap(...)
|
 x = devm_ioremap_nocache(...)
)

@@
expression r.x;
@@
* iounmap(x)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
drivers/watchdog/lantiq_wdt.c