]> git.karo-electronics.de Git - karo-tx-linux.git/commit
SCSI: mpt3sas: fix for kernel panic when driver loads with HBA conected to non LUN...
authorSreekanth Reddy <Sreekanth.Reddy@lsi.com>
Fri, 28 Jun 2013 22:22:03 +0000 (03:52 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 28 Jul 2013 23:30:12 +0000 (16:30 -0700)
commite90c1dc2c6298f7d369804aa7873d1c4c434f9d3
treee7d2f2aed5452e3ea3fb4b802a128eeca887fd30
parent72ffadbae16297ac86e31c759450e0e395209903
SCSI: mpt3sas: fix for kernel panic when driver loads with HBA conected to non LUN 0 configured expander

commit b65cfedf4560af65305bd7b3b9f26c02c6fb3660 upstream.

With some enclosures when LUN 0 is not created but LUN 1 or LUN X is created
then SCSI scan procedure calls target_alloc, slave_alloc call back functions
for LUN 0 and slave_destory() for same LUN 0.

In these kind of cases within slave_destroy, pointer to scsi_target in
_sas_device structure is set to NULL, following which when slave_alloc for LUN
1 is called then starget would not be set properly for this LUN.  So,
scsi_target pointer pointing to NULL value would lead to a crash later in the
discovery procedure.

To solve this issue set the sas_device's scsi_target pointer to scsi_device's
scsi_target if it is NULL earlier in slave_alloc callback function.

Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/mpt3sas/mpt3sas_scsih.c