diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2008-08-07 08:55:03 (GMT) |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-08-07 08:55:03 (GMT) |
commit | 4fb8af10d0fd09372d52966b76922b9e82bbc950 (patch) | |
tree | d240e4d40357583e3f3eb228dccf20122a5b31ed /drivers/scsi/ide-scsi.c | |
parent | f44f82e8a20b98558486eb14497b2f71c78fa325 (diff) | |
parent | 64a99d2a8c3ed5c4e39f3ae1cc682aa8fd3977fc (diff) | |
download | linux-fsl-qoriq-4fb8af10d0fd09372d52966b76922b9e82bbc950.tar.xz |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes
Diffstat (limited to 'drivers/scsi/ide-scsi.c')
-rw-r--r-- | drivers/scsi/ide-scsi.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c index b40a673..461331d 100644 --- a/drivers/scsi/ide-scsi.c +++ b/drivers/scsi/ide-scsi.c @@ -102,11 +102,10 @@ static struct ide_scsi_obj *ide_scsi_get(struct gendisk *disk) mutex_lock(&idescsi_ref_mutex); scsi = ide_scsi_g(disk); if (scsi) { - scsi_host_get(scsi->host); - if (ide_device_get(scsi->drive)) { - scsi_host_put(scsi->host); + if (ide_device_get(scsi->drive)) scsi = NULL; - } + else + scsi_host_get(scsi->host); } mutex_unlock(&idescsi_ref_mutex); return scsi; @@ -114,9 +113,11 @@ static struct ide_scsi_obj *ide_scsi_get(struct gendisk *disk) static void ide_scsi_put(struct ide_scsi_obj *scsi) { + ide_drive_t *drive = scsi->drive; + mutex_lock(&idescsi_ref_mutex); - ide_device_put(scsi->drive); scsi_host_put(scsi->host); + ide_device_put(drive); mutex_unlock(&idescsi_ref_mutex); } |