From: Julia Lawall Date: Mon, 11 Jul 2011 21:08:25 +0000 (-0700) Subject: [SCSI] ipr: reorder error handling code to include iounmap X-Git-Tag: v3.1-rc1~113^2~20 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f170c684b55cb8d3bab55b1fb8fa812778d551f2;p=pandora-kernel.git [SCSI] ipr: reorder error handling code to include iounmap The out_msi_disable label should be before cleanup_nomem to additionally benefit from the call to iounmap. Subsequent gotos are adjusted to go to out_msi_disable instead of cleanup_nomem, which now follows it. This is safe because pci_disable_msi does nothing if pci_enable_msi was not called. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r@ expression e1,e2; statement S; @@ e1 = pci_ioremap_bar(...); ... when != e1 = e2 when != iounmap(e1) when any ( if (<+...e1...+>) S | if(...) { ... return 0; } | if (...) { ... when != iounmap(e1) when != if (...) { ... iounmap(e1) ... } * return ...; } else S ) // Signed-off-by: Julia Lawall Acked-by: Brian King Signed-off-by: Andrew Morton Signed-off-by: James Bottomley --- Reading git-diff-tree failed