Skip to content

Commit

Permalink
[SCSI] scsi_transport_spi: fix for unbalanced reference counting
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mike Maslenkin authored and James Bottomley committed May 10, 2012
1 parent 9ebd99c commit 89a342c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/scsi/scsi_transport_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1010,10 +1010,10 @@ spi_dv_device(struct scsi_device *sdev)
u8 *buffer;
const int len = SPI_MAX_ECHO_BUFFER_SIZE*2;

if (unlikely(scsi_device_get(sdev)))
if (unlikely(spi_dv_in_progress(starget)))
return;

if (unlikely(spi_dv_in_progress(starget)))
if (unlikely(scsi_device_get(sdev)))
return;
spi_dv_in_progress(starget) = 1;

Expand Down

0 comments on commit 89a342c

Please sign in to comment.