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>
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;