From: Julia Lawall Date: Tue, 5 Feb 2008 06:27:44 +0000 (-0800) Subject: drivers/pcmcia: Add missing iounmap X-Git-Tag: v2.6.25-rc1~1028 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a1c3e1aa977457ded6fd0739e032c9684bf23bd;p=pandora-kernel.git drivers/pcmcia: Add missing iounmap of_iomap calls ioremap, and so should be matched with an iounmap. At the two error returns, the result of calling of_iomap is only stored in a local variable, so these error paths need to call iounmap. Furthermore, this function ultimately stores the result of of_iomap in an array that is local to the file. These values should be iounmapped at some point. I have added a corresponding call to iounmap at the end of the function m8xx_remove. The problem was found using the following semantic match. (http://www.emn.fr/x-info/coccinelle/) // @@ type T,T1,T2; identifier E; statement S; expression x1,x2,x3; int ret; @@ T E; ... * E = of_iomap(...); if (E == NULL) S ... when != iounmap(...,(T1)E,...) when != if (E != NULL) { ... iounmap(...,(T1)E,...); ...} when != x1 = (T1)E when != E = x3; when any if (...) { ... when != iounmap(...,(T2)E,...) when != if (E != NULL) { ... iounmap(...,(T2)E,...); ...} when != x2 = (T2)E ( * return; | * return ret; ) } // Signed-off-by: Julia Lawall Vitaly Bordug Cc: Arnd Bergmann Cc: Olof Johansson Cc: Dominik Brodowski Cc: Paul Mackerras Cc: Benjamin Herrenschmidt Cc: Kumar Gala Cc: Stephen Rothwell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed