diff options
author | Jack Wang <jack_wang@usish.com> | 2010-10-06 04:05:35 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-10-11 18:40:00 -0400 |
commit | 2bc72c91ea7e104b0e40151543d135b933a12e93 (patch) | |
tree | 50e5d393a70882ed513dbc402b82c1f1d2216fcc /drivers/scsi/libsas | |
parent | 526f7c7950bbf1271e59177d70d74438c2ef96de (diff) |
[SCSI] libsas: fix bug for vacant phy
This patch fix bug reported by Chuck. And this new version incorporate comments
from Hannes. Please consider to include it into mainline.
Signed-off-by: Jack Wang <jack_wang@usish.com>
Signed-off-by: Lindar Liu <lindar_liu@usish.com>
Tested-by: Chuck Tuffli <Chuck_Tuffli@pmc-sierra.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/libsas')
-rw-r--r-- | drivers/scsi/libsas/sas_expander.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c index 61d81f858a5a..505ffe358293 100644 --- a/drivers/scsi/libsas/sas_expander.c +++ b/drivers/scsi/libsas/sas_expander.c | |||
@@ -175,10 +175,10 @@ static void sas_set_ex_phy(struct domain_device *dev, int phy_id, | |||
175 | switch (resp->result) { | 175 | switch (resp->result) { |
176 | case SMP_RESP_PHY_VACANT: | 176 | case SMP_RESP_PHY_VACANT: |
177 | phy->phy_state = PHY_VACANT; | 177 | phy->phy_state = PHY_VACANT; |
178 | return; | 178 | break; |
179 | default: | 179 | default: |
180 | phy->phy_state = PHY_NOT_PRESENT; | 180 | phy->phy_state = PHY_NOT_PRESENT; |
181 | return; | 181 | break; |
182 | case SMP_RESP_FUNC_ACC: | 182 | case SMP_RESP_FUNC_ACC: |
183 | phy->phy_state = PHY_EMPTY; /* do not know yet */ | 183 | phy->phy_state = PHY_EMPTY; /* do not know yet */ |
184 | break; | 184 | break; |
@@ -209,7 +209,10 @@ static void sas_set_ex_phy(struct domain_device *dev, int phy_id, | |||
209 | phy->phy->negotiated_linkrate = phy->linkrate; | 209 | phy->phy->negotiated_linkrate = phy->linkrate; |
210 | 210 | ||
211 | if (!rediscover) | 211 | if (!rediscover) |
212 | sas_phy_add(phy->phy); | 212 | if (sas_phy_add(phy->phy)) { |
213 | sas_phy_free(phy->phy); | ||
214 | return; | ||
215 | } | ||
213 | 216 | ||
214 | SAS_DPRINTK("ex %016llx phy%02d:%c attached: %016llx\n", | 217 | SAS_DPRINTK("ex %016llx phy%02d:%c attached: %016llx\n", |
215 | SAS_ADDR(dev->sas_addr), phy->phy_id, | 218 | SAS_ADDR(dev->sas_addr), phy->phy_id, |