aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libsas/sas_expander.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-29 20:22:03 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-29 20:22:03 -0400
commita6ce22a5f61ba838b43763bf1e5be399f9dee4d0 (patch)
tree2abed83e85724bd45c5b0b842b9ce36d1c4ca160 /drivers/scsi/libsas/sas_expander.c
parent4e950f6f0189f65f8bf069cf2272649ef418f5e4 (diff)
parent09120a8cd38dbdb0c9a59ff8456cf88b510e6baa (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6: (28 commits) [SCSI] mpt fusion: Changes in mptctl.c for logging support [SCSI] mpt fusion: Changes in mptfc.c mptlan.c mptsas.c and mptspi.c for logging support [SCSI] mpt fusion: Changes in mptscsih.c for logging support [SCSI] mpt fusion: Changes in mptbase.c for logging support [SCSI] mpt fusion: logging support in Kconfig, Makefile, mptbase.h and addition of mptdebug.h [SCSI] libsas: Fix potential NULL dereference in sas_smp_get_phy_events() [SCSI] bsg: Fix build for CONFIG_BLOCK=n [SCSI] aacraid: fix Sunrise Lake reset handling [SCSI] aacraid: add SCSI SYNCHONIZE_CACHE range checking [SCSI] add easyRAID to the no report luns blacklist [SCSI] advansys: lindent and other large, uninteresting changes [SCSI] aic79xx, aic7xxx: Fix incorrect width setting [SCSI] qla2xxx: fix to honor ignored parameters in sysfs attributes [SCSI] aacraid: draw line in sand, sundry cleanup and version update [SCSI] iscsi_tcp: Turn off bounce buffers [SCSI] libiscsi: fix cmd seqeunce number checking [SCSI] iscsi_tcp, ib_iser Enable module refcounting for iscsi host template [SCSI] libiscsi: make sure session is not blocked when removing host [SCSI] libsas: Remove PCI dependencies [SCSI] simscsi: convert to use the data buffer accessors ...
Diffstat (limited to 'drivers/scsi/libsas/sas_expander.c')
-rw-r--r--drivers/scsi/libsas/sas_expander.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
index b500f0c1449c..8727436b222d 100644
--- a/drivers/scsi/libsas/sas_expander.c
+++ b/drivers/scsi/libsas/sas_expander.c
@@ -507,14 +507,21 @@ static int sas_dev_present_in_domain(struct asd_sas_port *port,
507int sas_smp_get_phy_events(struct sas_phy *phy) 507int sas_smp_get_phy_events(struct sas_phy *phy)
508{ 508{
509 int res; 509 int res;
510 u8 *req;
511 u8 *resp;
510 struct sas_rphy *rphy = dev_to_rphy(phy->dev.parent); 512 struct sas_rphy *rphy = dev_to_rphy(phy->dev.parent);
511 struct domain_device *dev = sas_find_dev_by_rphy(rphy); 513 struct domain_device *dev = sas_find_dev_by_rphy(rphy);
512 u8 *req = alloc_smp_req(RPEL_REQ_SIZE);
513 u8 *resp = kzalloc(RPEL_RESP_SIZE, GFP_KERNEL);
514 514
515 if (!resp) 515 req = alloc_smp_req(RPEL_REQ_SIZE);
516 if (!req)
516 return -ENOMEM; 517 return -ENOMEM;
517 518
519 resp = alloc_smp_resp(RPEL_RESP_SIZE);
520 if (!resp) {
521 kfree(req);
522 return -ENOMEM;
523 }
524
518 req[1] = SMP_REPORT_PHY_ERR_LOG; 525 req[1] = SMP_REPORT_PHY_ERR_LOG;
519 req[9] = phy->number; 526 req[9] = phy->number;
520 527
@@ -1879,7 +1886,7 @@ int sas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
1879 struct request *req) 1886 struct request *req)
1880{ 1887{
1881 struct domain_device *dev; 1888 struct domain_device *dev;
1882 int ret, type = rphy->identify.device_type; 1889 int ret, type;
1883 struct request *rsp = req->next_rq; 1890 struct request *rsp = req->next_rq;
1884 1891
1885 if (!rsp) { 1892 if (!rsp) {
@@ -1888,12 +1895,13 @@ int sas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
1888 return -EINVAL; 1895 return -EINVAL;
1889 } 1896 }
1890 1897
1891 /* seems aic94xx doesn't support */ 1898 /* no rphy means no smp target support (ie aic94xx host) */
1892 if (!rphy) { 1899 if (!rphy) {
1893 printk("%s: can we send a smp request to a host?\n", 1900 printk("%s: can we send a smp request to a host?\n",
1894 __FUNCTION__); 1901 __FUNCTION__);
1895 return -EINVAL; 1902 return -EINVAL;
1896 } 1903 }
1904 type = rphy->identify.device_type;
1897 1905
1898 if (type != SAS_EDGE_EXPANDER_DEVICE && 1906 if (type != SAS_EDGE_EXPANDER_DEVICE &&
1899 type != SAS_FANOUT_EXPANDER_DEVICE) { 1907 type != SAS_FANOUT_EXPANDER_DEVICE) {