aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/vme/bridges
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2010-05-26 11:59:11 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-06-18 18:16:21 -0400
commit7c0ace54887872ebd99fefdfe85d273295a09426 (patch)
tree2464f7f639986bff887d795ca3b5e5787f8ad43b /drivers/staging/vme/bridges
parent45f9f018967c3fc112a03a99a8fdfad3621407a7 (diff)
Staging: vme: bridges: Add missing unlocks
Add a spin_unlock and mutex_unlock missing on the error path. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression E1; @@ * spin_lock(E1,...); <+... when != E1 if (...) { ... when != E1 * return ...; } ...+> * spin_unlock(E1,...); // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Martyn Welch <martyn.welch@ge.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/vme/bridges')
-rw-r--r--drivers/staging/vme/bridges/vme_ca91cx42.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/vme/bridges/vme_ca91cx42.c b/drivers/staging/vme/bridges/vme_ca91cx42.c
index 0f9ea58ff71..16cf53e38a7 100644
--- a/drivers/staging/vme/bridges/vme_ca91cx42.c
+++ b/drivers/staging/vme/bridges/vme_ca91cx42.c
@@ -900,7 +900,8 @@ unsigned int ca91cx42_master_rmw(struct vme_master_resource *image,
900 /* Address must be 4-byte aligned */ 900 /* Address must be 4-byte aligned */
901 if (pci_addr & 0x3) { 901 if (pci_addr & 0x3) {
902 dev_err(dev, "RMW Address not 4-byte aligned\n"); 902 dev_err(dev, "RMW Address not 4-byte aligned\n");
903 return -EINVAL; 903 result = -EINVAL;
904 goto out;
904 } 905 }
905 906
906 /* Ensure RMW Disabled whilst configuring */ 907 /* Ensure RMW Disabled whilst configuring */
@@ -921,6 +922,7 @@ unsigned int ca91cx42_master_rmw(struct vme_master_resource *image,
921 /* Disable RMW */ 922 /* Disable RMW */
922 iowrite32(0, bridge->base + SCYC_CTL); 923 iowrite32(0, bridge->base + SCYC_CTL);
923 924
925out:
924 spin_unlock(&(image->lock)); 926 spin_unlock(&(image->lock));
925 927
926 mutex_unlock(&(bridge->vme_rmw)); 928 mutex_unlock(&(bridge->vme_rmw));