changeset 4882:272a171bc996

6531069 SCSI2 (tc_mhioctkown test cases) testing are showing UNRESOLVED results for ST2530 6588278 mpt driver doesn't check GUID of LUN when the path online 6591973 panic in mdi_pi_free() when remapping devices
author jw149990
date Thu, 16 Aug 2007 20:51:30 -0700
parents 0b31383eeee3
children 880ca7e5862c
files usr/src/uts/common/io/scsi/adapters/scsi_vhci/scsi_vhci.c
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/io/scsi/adapters/scsi_vhci/scsi_vhci.c	Thu Aug 16 20:13:23 2007 -0700
+++ b/usr/src/uts/common/io/scsi/adapters/scsi_vhci/scsi_vhci.c	Thu Aug 16 20:51:30 2007 -0700
@@ -1624,6 +1624,12 @@
 		return (rval);
 	}
 
+	if (vlun == NULL) {
+		VHCI_DEBUG(3, (CE_WARN, vhci->vhci_dip,
+		    "!vhci_commoncap: vlun is null"));
+		return (rval);
+	}
+
 	if ((cidx = scsi_hba_lookup_capstr(cap)) == -1) {
 		return (UNDEFINED);
 	}
@@ -7070,6 +7076,13 @@
 {
 	struct scsi_vhci_lun *dvlp;
 	char *guid;
+	struct scsi_device *sd;
+
+	/*
+	 * The scsi_device was set to driver private during child node
+	 * initialization in the scsi_hba_bus_ctl().
+	 */
+	sd = (struct scsi_device *)ddi_get_driver_private(tgt_dip);
 
 	dvlp = (struct scsi_vhci_lun *)
 	    mdi_client_get_vhci_private(tgt_dip);
@@ -7106,6 +7119,8 @@
 	cv_destroy(&dvlp->svl_cv);
 	sema_destroy(&dvlp->svl_pgr_sema);
 	kmem_free(dvlp, sizeof (*dvlp));
+
+	sd->sd_address.a_hba_tran->tran_tgt_private = NULL;
 }