Skip to content

Commit

Permalink
[SCSI] libsas: check for 'gone' expanders in smp_execute_task()
Browse files Browse the repository at this point in the history
No sense in issuing or retrying commands to an expander that has been
removed.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
  • Loading branch information
Dan Williams authored and James Bottomley committed Feb 29, 2012
1 parent 0508c2f commit 3a9c556
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/scsi/libsas/sas_expander.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ static int smp_execute_task(struct domain_device *dev, void *req, int req_size,

mutex_lock(&dev->ex_dev.cmd_mutex);
for (retry = 0; retry < 3; retry++) {
if (test_bit(SAS_DEV_GONE, &dev->state)) {
res = -ECOMM;
break;
}

task = sas_alloc_task(GFP_KERNEL);
if (!task) {
res = -ENOMEM;
Expand Down

0 comments on commit 3a9c556

Please sign in to comment.