aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2008-07-21 03:58:30 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-07-26 15:14:56 -0400
commit773e82f6cdb026282ff7d26aaac291a5fa84ee3a (patch)
tree755c98045690c2b6f4c588384cb46267bf487bf2
parent12265709ac6e197f4d40d9ec1fd3af97b4196a35 (diff)
[SCSI] scsi_scan.c: Release mutex in error handling code
The mutex is released on a successful return, so it would seem that it should be released on an error return as well. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @@ expression l; @@ mutex_lock(l); ... when != mutex_unlock(l) when any when strict ( if (...) { ... when != mutex_unlock(l) + mutex_unlock(l); return ...; } | mutex_unlock(l); ) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r--drivers/scsi/scsi_scan.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 196fe3af0d5e..b7b74489fce7 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -1760,6 +1760,7 @@ static void scsi_finish_async_scan(struct async_scan_data *data)
1760 printk("%s called twice for host %d", __FUNCTION__, 1760 printk("%s called twice for host %d", __FUNCTION__,
1761 shost->host_no); 1761 shost->host_no);
1762 dump_stack(); 1762 dump_stack();
1763 mutex_unlock(&shost->scan_mutex);
1763 return; 1764 return;
1764 } 1765 }
1765 1766