aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Maslenkin <mihailm@parallels.com>2012-04-27 21:32:14 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-05-10 04:06:12 -0400
commit89a342ca6bfc1a014ff50cce5659abc58e11ecfc (patch)
treee6e7760d0b953f3f76f3dfd7d16bbcbddca3ab26
parent9ebd99c599bcb125acde9b3c98383ebd6e208bc1 (diff)
[SCSI] scsi_transport_spi: fix for unbalanced reference counting
Check the domain validation flag on the given device before referencing scsi_device instance, otherwise if the flag is already set we return without decrementing the reference count. Signed-off-by: Mike Maslenkin <mihailm@parallels.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r--drivers/scsi/scsi_transport_spi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c
index a2715c31e754..cf08071a9b6e 100644
--- a/drivers/scsi/scsi_transport_spi.c
+++ b/drivers/scsi/scsi_transport_spi.c
@@ -1010,10 +1010,10 @@ spi_dv_device(struct scsi_device *sdev)
1010 u8 *buffer; 1010 u8 *buffer;
1011 const int len = SPI_MAX_ECHO_BUFFER_SIZE*2; 1011 const int len = SPI_MAX_ECHO_BUFFER_SIZE*2;
1012 1012
1013 if (unlikely(scsi_device_get(sdev))) 1013 if (unlikely(spi_dv_in_progress(starget)))
1014 return; 1014 return;
1015 1015
1016 if (unlikely(spi_dv_in_progress(starget))) 1016 if (unlikely(scsi_device_get(sdev)))
1017 return; 1017 return;
1018 spi_dv_in_progress(starget) = 1; 1018 spi_dv_in_progress(starget) = 1;
1019 1019