Patch to clear driver specific data from struct device associated with
a tape drive when released by st unload or because there was a problem
attaching to the device. Currently set in st_probe but never cleared.

Signed-off-by: Shane Seymour <shane.seym...@hp.com>
Tested-by: Shane Seymour <shane.seym...@hp.com>
---
diff -uprN linux-3.9-vanilla/drivers/scsi/st.c linux-3.9/drivers/scsi/st.c
--- linux-3.9-vanilla/drivers/scsi/st.c 2013-04-29 01:36:01.000000000 +0100
+++ linux-3.9/drivers/scsi/st.c 2013-04-30 02:39:51.000000000 +0100
@@ -4212,6 +4212,7 @@ static int st_probe(struct device *dev)
 
 out_remove_devs:
        remove_cdevs(tpnt);
+       dev_set_drvdata(dev, NULL);
        spin_lock(&st_index_lock);
        idr_remove(&st_index_idr, tpnt->index);
        spin_unlock(&st_index_lock);
@@ -4258,6 +4259,7 @@ static void scsi_tape_release(struct kre
        struct scsi_tape *tpnt = to_scsi_tape(kref);
        struct gendisk *disk = tpnt->disk;
 
+       dev_set_drvdata(&tpnt->device->sdev_gendev, NULL);
        tpnt->device = NULL;
 
        if (tpnt->buffer) {
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to