aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2008-07-21 09:58:30 +0200
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-07-26 15:14:56 -0400
commit773e82f6cdb026282ff7d26aaac291a5fa84ee3a (patch)
tree755c98045690c2b6f4c588384cb46267bf487bf2 /drivers
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>
Diffstat (limited to 'drivers')
-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 196fe3af0d5..b7b74489fce 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)
printk("%s called twice for host %d", __FUNCTION__,
shost->host_no);
dump_stack();
+ mutex_unlock(&shost->scan_mutex);
return;
}