diff options
-rw-r--r-- | drivers/target/target_core_pscsi.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c index 6e32ff6f2fa0..5552fa7426bc 100644 --- a/drivers/target/target_core_pscsi.c +++ b/drivers/target/target_core_pscsi.c | |||
@@ -673,8 +673,15 @@ static int pscsi_transport_complete(struct se_cmd *cmd, struct scatterlist *sg) | |||
673 | struct scsi_device *sd = pdv->pdv_sd; | 673 | struct scsi_device *sd = pdv->pdv_sd; |
674 | int result; | 674 | int result; |
675 | struct pscsi_plugin_task *pt = cmd->priv; | 675 | struct pscsi_plugin_task *pt = cmd->priv; |
676 | unsigned char *cdb = &pt->pscsi_cdb[0]; | 676 | unsigned char *cdb; |
677 | /* | ||
678 | * Special case for REPORT_LUNs handling where pscsi_plugin_task has | ||
679 | * not been allocated because TCM is handling the emulation directly. | ||
680 | */ | ||
681 | if (!pt) | ||
682 | return 0; | ||
677 | 683 | ||
684 | cdb = &pt->pscsi_cdb[0]; | ||
678 | result = pt->pscsi_result; | 685 | result = pt->pscsi_result; |
679 | /* | 686 | /* |
680 | * Hack to make sure that Write-Protect modepage is set if R/O mode is | 687 | * Hack to make sure that Write-Protect modepage is set if R/O mode is |