aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-scsi.c
diff options
context:
space:
mode:
authorJeremy Erickson <jerickso@cs.unc.edu>2014-04-18 17:06:00 -0400
committerJeremy Erickson <jerickso@cs.unc.edu>2014-04-18 17:06:00 -0400
commita215aa7b9ab3759c047201199fba64d3042d7f13 (patch)
treebca37493d9b2233450e6d3ffced1261d0e4f71fe /drivers/ata/libata-scsi.c
parentd31199a77ef606f1d06894385f1852181ba6136b (diff)
Update 2.6.36 to 2.6.36.4wip-dissipation2-jerickso
Diffstat (limited to 'drivers/ata/libata-scsi.c')
-rw-r--r--drivers/ata/libata-scsi.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index a89172c100f5..7bb6787de550 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -2577,8 +2577,11 @@ static void atapi_qc_complete(struct ata_queued_cmd *qc)
2577 * 2577 *
2578 * If door lock fails, always clear sdev->locked to 2578 * If door lock fails, always clear sdev->locked to
2579 * avoid this infinite loop. 2579 * avoid this infinite loop.
2580 *
2581 * This may happen before SCSI scan is complete. Make
2582 * sure qc->dev->sdev isn't NULL before dereferencing.
2580 */ 2583 */
2581 if (qc->cdb[0] == ALLOW_MEDIUM_REMOVAL) 2584 if (qc->cdb[0] == ALLOW_MEDIUM_REMOVAL && qc->dev->sdev)
2582 qc->dev->sdev->locked = 0; 2585 qc->dev->sdev->locked = 0;
2583 2586
2584 qc->scsicmd->result = SAM_STAT_CHECK_CONDITION; 2587 qc->scsicmd->result = SAM_STAT_CHECK_CONDITION;